🔧
This commit is contained in:
8
vendor/symfony/process/PhpSubprocess.php
vendored
8
vendor/symfony/process/PhpSubprocess.php
vendored
@@ -51,7 +51,7 @@ class PhpSubprocess extends Process
|
||||
* @param int $timeout The timeout in seconds
|
||||
* @param array|null $php Path to the PHP binary to use with any additional arguments
|
||||
*/
|
||||
public function __construct(array $command, string $cwd = null, array $env = null, int $timeout = 60, array $php = null)
|
||||
public function __construct(array $command, ?string $cwd = null, ?array $env = null, int $timeout = 60, ?array $php = null)
|
||||
{
|
||||
if (null === $php) {
|
||||
$executableFinder = new PhpExecutableFinder();
|
||||
@@ -73,12 +73,12 @@ class PhpSubprocess extends Process
|
||||
parent::__construct($command, $cwd, $env, null, $timeout);
|
||||
}
|
||||
|
||||
public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60): static
|
||||
public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60): static
|
||||
{
|
||||
throw new LogicException(sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class));
|
||||
}
|
||||
|
||||
public function start(callable $callback = null, array $env = []): void
|
||||
public function start(?callable $callback = null, array $env = []): void
|
||||
{
|
||||
if (null === $this->getCommandLine()) {
|
||||
throw new RuntimeException('Unable to find the PHP executable.');
|
||||
@@ -106,7 +106,7 @@ class PhpSubprocess extends Process
|
||||
throw new RuntimeException('Unable to read ini: '.$file);
|
||||
}
|
||||
// Check and remove directives after HOST and PATH sections
|
||||
if (preg_match('/^\s*\[(?:PATH|HOST)\s*=/mi', $data, $matches)) {
|
||||
if (preg_match('/^\s*\[(?:PATH|HOST)\s*=/mi', $data, $matches, \PREG_OFFSET_CAPTURE)) {
|
||||
$data = substr($data, 0, $matches[0][1]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user