Skip to content

Commit 2b9b78e

Browse files
committed
fix(Adapaters/Process) shim fromShellCommandline method
1 parent 4edec26 commit 2b9b78e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Adapters/Symfony/Component/Process/Process.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,22 @@ public function createNewConsole(): void
7979
$options['bypass_shell'] = true;
8080
$optionsReflectionProperty->setValue($this, $options);
8181
}
82+
83+
/**
84+
* @param array<mixed> $arguments
85+
*/
86+
public static function __callStatic(string $name, array $arguments):mixed
87+
{
88+
if ($name === 'fromShellCommandline') {
89+
$command = array_shift($arguments);
90+
$process = new self([], ...$arguments); // @phpstan-ignore-line
91+
$processCommandLineProperty = new \ReflectionProperty(SymfonyProcess::class, 'commandline');
92+
$processCommandLineProperty->setAccessible(true);
93+
$processCommandLineProperty->setValue($process, $command);
94+
95+
return $process;
96+
}
97+
98+
return null;
99+
}
82100
}

0 commit comments

Comments
 (0)