1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 08:30:07 +01:00

Merge pull request #766 from Padrio/master

Fixed warning on newer symfony/process versions
This commit is contained in:
Matt Stauffer
2019-04-11 15:43:00 -04:00
committed by GitHub

View File

@@ -74,7 +74,14 @@ function runCommand($command, callable $onError = null)
{
$onError = $onError ?: function () {};
$process = new Process($command);
// Symfony 4.x throws a warning when the command string is passed to the constructor
// But the version constraint allows older versions, too
// 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) {