Skip to content

Commit 83ec37d

Browse files
committed
wip
1 parent b54f2d6 commit 83ec37d

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

src/Loaders/BaseLoader.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ public function init()
1919
$config->setUpdateCheck(Checker::NEVER);
2020
$config->setRawOutput(true);
2121
$config->setInteractiveMode(Configuration::INTERACTIVE_MODE_DISABLED);
22+
$config->setColorMode(Configuration::COLOR_MODE_DISABLED);
23+
$config->setTheme([
24+
'prompt' => '',
25+
]);
26+
$config->setVerbosity(Configuration::VERBOSITY_QUIET);
27+
$config->setHistoryFile(defined('PHP_WINDOWS_VERSION_BUILD') ? 'null' : '/dev/null');
28+
$config->setRawOutput(false);
2229

2330
if (class_exists('Illuminate\Support\Collection') && class_exists('Laravel\Tinker\TinkerCaster')) {
2431
$config->getPresenter()->addCasters([

src/Tinker.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace TweakPHP\Client;
44

5+
use Psy\Configuration;
56
use Psy\ExecutionLoopClosure;
67
use Psy\Shell;
78
use Symfony\Component\Console\Output\BufferedOutput;
@@ -15,7 +16,7 @@ class Tinker
1516

1617
protected OutputModifier $outputModifier;
1718

18-
public function __construct(OutputModifier $outputModifier, $config)
19+
public function __construct(OutputModifier $outputModifier, Configuration $config)
1920
{
2021
$this->output = new BufferedOutput();
2122

@@ -28,23 +29,17 @@ public function execute(string $phpCode): string
2829
{
2930
$phpCode = $this->removeComments($phpCode);
3031

31-
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
32-
$this->shell->execute($phpCode);
33-
} else {
34-
$this->shell->addInput($phpCode);
35-
$closure = new ExecutionLoopClosure($this->shell);
36-
$closure->execute();
37-
}
32+
$this->shell->addInput($phpCode);
33+
$closure = new ExecutionLoopClosure($this->shell);
34+
$closure->execute();
3835

3936
$output = $this->cleanOutput($this->output->fetch());
4037

4138
return $this->outputModifier->modify($output);
4239
}
4340

44-
protected function createShell(BufferedOutput $output, $config): Shell
41+
protected function createShell(BufferedOutput $output, Configuration $config): Shell
4542
{
46-
$config->setHistoryFile(defined('PHP_WINDOWS_VERSION_BUILD') ? 'null' : '/dev/null');
47-
4843
$shell = new Shell($config);
4944

5045
$shell->setOutput($output);

0 commit comments

Comments
 (0)