From 18cddd336a869536300cc1bd5758a302ccf6f272 Mon Sep 17 00:00:00 2001 From: Pascal Krason Date: Thu, 11 Apr 2019 20:20:23 +0200 Subject: [PATCH] Fixed warning on newer symfony/process versions --- cli/Valet/CommandLine.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/Valet/CommandLine.php b/cli/Valet/CommandLine.php index c59bc8e..d850a3f 100644 --- a/cli/Valet/CommandLine.php +++ b/cli/Valet/CommandLine.php @@ -74,7 +74,11 @@ function runCommand($command, callable $onError = null) { $onError = $onError ?: function () {}; - $process = new Process($command); + 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) {