From 3030f33c4deccf088afbfcc7ed2f818d339a8687 Mon Sep 17 00:00:00 2001 From: Massimiliano Arione Date: Thu, 25 Feb 2021 13:56:29 +0100 Subject: [PATCH] Support php8 (#168) * Enable upgrade to PHP 8.0 Co-authored-by: Steven Garcia --- .travis.yml | 8 +++++--- composer.json | 14 +++++++------- src/Process/ProcessFactory.php | 8 ++++++-- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index ba2e162..b1499b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,14 @@ language: php +dist: bionic php: - 7.3 - 7.4 + - 8.0 env: matrix: - - PREFER_LOWEST="--prefer-lowest" PHPUNIT_VERSION="^8.2" - - PREFER_LOWEST="" PHPUNIT_VERSION="^8.2" + - PREFER_LOWEST="--prefer-lowest" PHPUNIT_VERSION="~8.5.10" - PREFER_LOWEST="" PHPUNIT_VERSION="~9.0" - PREFER_LOWEST="" PHPUNIT_VERSION="~9.3" - PREFER_LOWEST="" PHPUNIT_VERSION="~9.5" @@ -20,7 +21,8 @@ before_script: - phpenv config-rm xdebug.ini - composer selfupdate - composer require "phpunit/phpunit:$PHPUNIT_VERSION" --no-update; - - composer update $PREFER_LOWEST + - if [ ${TRAVIS_PHP_VERSION:0:3} == "8.0" ]; then composer require "symfony/config:^3.4.44|^4.4.12" "symfony/dependency-injection:^3.4.44|^4.4.12" --no-update; fi; + - composer update $PREFER_LOWEST --prefer-dist --no-interaction --no-progress --ignore-platform-req=php script: - bin/phpstan.phar analyze src tests diff --git a/composer.json b/composer.json index 90d8ffa..a07c727 100644 --- a/composer.json +++ b/composer.json @@ -9,16 +9,16 @@ } ], "require": { - "php": "^7.3", - "symfony/console": "^3.4|^4.2|^5.0", - "symfony/stopwatch": "^3.4|^4.2|^5.0", - "symfony/process": "^3.4|^4.2|^5.0", + "php": "^7.3 || ^8.0", + "symfony/console": "^3.4|^4.4|^5.0", + "symfony/stopwatch": "^3.4|^4.4|^5.0", + "symfony/process": "^3.4|^4.4|^5.0", "doctrine/collections": "^1.2" }, "require-dev": { - "behat/behat": "^3.3", - "phpstan/phpstan": "^0.12.48", - "phpstan/phpstan-phpunit": "^0.12.16" + "behat/behat": "^3.6", + "phpstan/phpstan": "^0.12.78", + "phpstan/phpstan-phpunit": "^0.12.17" }, "config": { "bin-dir": "bin/" diff --git a/src/Process/ProcessFactory.php b/src/Process/ProcessFactory.php index 40b53f8..3fb30e0 100644 --- a/src/Process/ProcessFactory.php +++ b/src/Process/ProcessFactory.php @@ -133,7 +133,9 @@ private static function getWindowsBinCmd(): string return 'bin\phpunit {}'; } - if (file_exists(getenv('APPDATA').'\Composer\vendor\bin\phpunit')) { + /** @var string $appData */ + $appData = getenv('APPDATA'); + if (file_exists($appData.'\Composer\vendor\bin\phpunit')) { return '%APPDATA%\Composer\vendor\bin\phpunit {}'; } @@ -150,7 +152,9 @@ private static function getUnixBinCmd(): string return 'bin/phpunit {}'; } - if (file_exists(getenv('HOME').'/.composer/vendor/bin/phpunit')) { + /** @var string $home */ + $home = getenv('HOME'); + if (file_exists($home.'/.composer/vendor/bin/phpunit')) { return '~/.composer/vendor/bin/phpunit {}'; }