From 4090eb3e8a237c14637061c13c88734e9506daad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20SURACI?= Date: Tue, 8 Sep 2020 09:14:28 +0200 Subject: [PATCH] #205 - Bumps consolidation/robo to ~2, and handle symfony/process prototype change --- composer.json | 2 +- src/Tools/GetVersions.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 042b0a82..7f83d537 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "require": { "php": ">=5.4", "ext-xsl": "*", - "consolidation/robo": "~0.5|~1", + "consolidation/robo": "~0.5|~1|~2", "phpmd/phpmd" : "*", "phploc/phploc": "*", "symfony/dependency-injection": ">=2.8.50", diff --git a/src/Tools/GetVersions.php b/src/Tools/GetVersions.php index 429f011f..74abf311 100644 --- a/src/Tools/GetVersions.php +++ b/src/Tools/GetVersions.php @@ -131,6 +131,12 @@ function ($author) { private function loadVersionFromConsoleCommand($command) { + // Since symfony/process 5.x, Process' constructor argument $command is typed as array and + // setCommandLine has been removed since then, easy way to detect if symfony/process > 5.0.0 + if (!method_exists('Symfony\\Component\\Process\\Process', 'setCommandLine')) { + $command = [$command]; + } + $process = new Process($command); $process->run(); $firstLine = $this->getFirstLine($process->getOutput());