From 379fcdb178c38a45a68c973b30e1d704495a2c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zdene=CC=8Ck=20Drahos=CC=8C?= Date: Sat, 6 Feb 2021 08:56:58 +0100 Subject: [PATCH] CI - show phpunit version from custom binary, fix version on php7.4 https://github.com/EdgedesignCZ/phpqa/runs/1844108206?check_suite_focus=true#step:6:40 `phpqa tools` shows phpunit 9.5.2 (loaded from composer.lock) No version is displayed in html artifact for php7.4. But it works for php8.0. - php8 - https://github.com/EdgedesignCZ/phpqa/runs/1844183851?check_suite_focus=true#step:6:27 - php7.4 - https://github.com/EdgedesignCZ/phpqa/runs/1844183845?check_suite_focus=true#step:6:27 sh: 1: exec: "/home/runner/work/phpqa/phpqa/vendor/phpunit/phpunit/phpunit" --version: not found Related to https://github.com/EdgedesignCZ/phpqa/commit/148151c: - PHP8 warning: Passing a command as string when creating a "Symfony\Component\Process\Process" instance is deprecated since Symfony 4.2, pass it as an array of its arguments instead, or use the "Process::fromShellCommandline()" constructor if you need features provided by the shell. - https://github.com/symfony/process/blob/5.x/CHANGELOG.md#500 --- .github/workflows/php.yml | 2 +- appveyor.yml | 2 +- src/Tools/GetVersions.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 5325396e..21011072 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -64,7 +64,7 @@ jobs: - name: Show versions run: | composer outdated --direct --all - ./phpqa tools + ./phpqa tools --config tests/.ci - name: Run tests run: | diff --git a/appveyor.yml b/appveyor.yml index 4327f0b8..8dae634f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -47,7 +47,7 @@ install: test_script: - cd C:\projects\phpqa - - php phpqa tools + - php phpqa tools --config tests/.appveyor - php phpqa --verbose --report --config tests/.appveyor - dir build diff --git a/src/Tools/GetVersions.php b/src/Tools/GetVersions.php index bdb11efc..31089bfe 100644 --- a/src/Tools/GetVersions.php +++ b/src/Tools/GetVersions.php @@ -140,8 +140,8 @@ private function loadVersionFromConsoleCommand($command) private function createSymfonyProcess($command) { - if (!method_exists('Symfony\Component\Process\Process', 'setCommandLine')) { - return new Process([$command]); + if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) { + return Process::fromShellCommandline($command); } else { return new Process($command); }