Skip to content

Commit

Permalink
Merge pull request #248 from filkrav/develop
Browse files Browse the repository at this point in the history
Updates symfony/process dependency to 5.0 and fixes deprecated Process argument passed as string
  • Loading branch information
jmarcher authored Dec 2, 2019
2 parents 534b0c4 + deb3bf8 commit 759f3e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion cli/Valet/CommandLine.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,15 @@ protected function runCommand($command, callable $onError = null)
$onError = $onError ?: function () {
};

$process = new Process($command);
// Symfony's 4.x Process component has deprecated passing a command string
// to the constructor, but older versions (which Valet's Composer
// constraints allow) don't have the fromShellCommandLine method.
// For more information, see: https://github.com/laravel/valet/pull/761
if (method_exists(Process::class, 'fromShellCommandline')) {
$process = Process::fromShellCommandline($command);
} else {
$process = new Process($command);
}

$processOutput = '';
$process->setTimeout(null)->run(function ($type, $line) use (&$processOutput) {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"php": ">=7.0",
"illuminate/container": "~5.3|^6.0",
"mnapoli/silly": "~1.1",
"symfony/process": "~2.7|~3.0|~4.0",
"symfony/process": "~2.7|~3.0|~4.0|~5.0",
"nategood/httpful": "~0.2",
"tightenco/collect": "~5.3|^6.0",
"ext-posix": "*",
Expand Down

0 comments on commit 759f3e4

Please sign in to comment.