Skip to content

Commit f71240d

Browse files
mmollxalopp
authored andcommitted
Support PHP 8.0 and add Travis testing
1 parent 0c3130b commit f71240d

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

Diff for: .travis.yml

+16-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
sudo: false
21
os:
32
- linux
43
language: php
54
php:
65
- 7.2
76
- 7.3
87
- 7.4
8+
- 8.0
99
env:
1010
- DEPENDENCIES=lowest
1111
- DEPENDENCIES=highest
@@ -20,8 +20,16 @@ cache:
2020
- $HOME/.composer/cache
2121

2222
before_script:
23-
- if [ "${DEPENDENCIES}" = "lowest" ]; then composer update --prefer-lowest --prefer-dist --no-interaction --no-progress; fi;
24-
- if [ "${DEPENDENCIES}" = "highest" ]; then composer update --prefer-dist --no-interaction --no-progress; fi;
23+
# PHPUnit 8.x is not (yet) supported, so prevent issues with Travis images using it.
24+
- |
25+
if [ "${TRAVIS_PHP_VERSION}" != "8.0" ]; then
26+
export PHPUNIT_WORKAROUND=""
27+
elif [ "${TRAVIS_PHP_VERSION}" = "8.0" ]; then
28+
# Allow installing "incompatible" PHPUnit version on PHP 8.
29+
export PHPUNIT_WORKAROUND="--ignore-platform-reqs"
30+
fi
31+
- if [ "${DEPENDENCIES}" = "lowest" ]; then composer update ${PHPUNIT_WORKAROUND} --prefer-lowest --prefer-dist --no-interaction --no-progress; fi;
32+
- if [ "${DEPENDENCIES}" = "highest" ]; then composer update ${PHPUNIT_WORKAROUND} --prefer-dist --no-interaction --no-progress; fi;
2533
- if [ "${DEPENDENCIES}" = "highest" ]; then pecl install -f ast-1.0.10; fi; # Install AST extension, as phan uses it
2634
- export XMLLINT_INDENT=" "
2735

@@ -48,17 +56,18 @@ script:
4856
jobs:
4957
include:
5058
- stage: Test
51-
name: PHP:7.3 Windows
59+
name: PHP:8.0 Windows
5260
os: windows
5361
cache:
5462
directories:
5563
- C:/Users/travis/AppData/Local/Composer
56-
language: sh # No PHP currently
64+
language: shell # No PHP currently
5765
env:
58-
- PHP_VERSION=7.3
66+
- TRAVIS_PHP_VERSION=8.0
5967
- DEPENDENCIES=lowest
6068
install:
61-
- export EXACT_PHP_VERSION=$(choco search php --exact --all-versions --limit-output | grep $PHP_VERSION | cut -d \| -f 2)
69+
# this doesn't work since choco 0.10.14 and currently there's no workaround, so the highest available version is used always
70+
- export EXACT_PHP_VERSION=$(choco search php --exact --all-versions --limit-output | grep $TRAVIS_PHP_VERSION | cut -d \| -f 2)
6271
- choco install php --version=${EXACT_PHP_VERSION} --package-parameters="/InstallDir:c:\tools\php"
6372
- choco install composer --ia "/DEV=C:\tools\php"
6473
- export PATH=/c/tools/php:$PATH

Diff for: composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"vimeo/psalm": "^4.0"
3030
},
3131
"require": {
32-
"php": "~7.2",
32+
"php": "~7.2 || ~8.0",
3333
"dealerdirect/phpcodesniffer-composer-installer": "~0.7",
3434
"escapestudios/symfony2-coding-standard": "^3.10.0",
3535
"slevomat/coding-standard": "^6.2.0",

0 commit comments

Comments
 (0)