22
33namespace TweakPHP \Client ;
44
5+ use Psy \Configuration ;
56use Psy \ExecutionLoopClosure ;
67use Psy \Shell ;
78use 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