mirror of
https://github.com/laravel/valet.git
synced 2026-02-05 16:40:05 +01:00
Merge pull request #766 from Padrio/master
Fixed warning on newer symfony/process versions
This commit is contained in:
@@ -74,7 +74,14 @@ function runCommand($command, callable $onError = null)
|
|||||||
{
|
{
|
||||||
$onError = $onError ?: function () {};
|
$onError = $onError ?: function () {};
|
||||||
|
|
||||||
|
// 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);
|
$process = new Process($command);
|
||||||
|
}
|
||||||
|
|
||||||
$processOutput = '';
|
$processOutput = '';
|
||||||
$process->setTimeout(null)->run(function ($type, $line) use (&$processOutput) {
|
$process->setTimeout(null)->run(function ($type, $line) use (&$processOutput) {
|
||||||
|
|||||||
Reference in New Issue
Block a user