Skip to content

Commit

Permalink
Support php8 (#168)
Browse files Browse the repository at this point in the history
* Enable upgrade to PHP 8.0

Co-authored-by: Steven Garcia <stevenbgarcia@protonmail.com>
  • Loading branch information
garak and webdevel authored Feb 25, 2021
1 parent ef1ac47 commit 3030f33
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
8 changes: 6 additions & 2 deletions src/Process/ProcessFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}';
}

Expand All @@ -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 {}';
}

Expand Down

0 comments on commit 3030f33

Please sign in to comment.