Skip to content

Commit db97d73

Browse files
committed
Allow installation on PHP 8
As it was, the plugin when used by external standards, would block them from being tested on PHP 8. As all the dependencies in the `require` section allow for PHP 8, there is no reason not to allow it. The only dependencies currently in use which do not allow for PHP 8 yet are in the `require-dev` section. See the below output. This includes updating the Travis script to only do a full (`dev`) install when not on `nightly` and as PHPCompatibility is in the `require-dev` section, we need to require explicitly for `nightly` to make sure the integration test can run. ```bash # composer prohibits php:8 composer/composer 1.9.3 requires php (^5.3.2 || ^7.0) composer/semver 1.5.1 requires php (^5.3.2 || ^7.0) seld/jsonlint 1.7.2 requires php (^5.3 || ^7.0) symfony/console v4.4.4 requires php (^7.1.3) symfony/filesystem v4.4.4 requires php (^7.1.3) symfony/finder v4.4.4 requires php (^7.1.3) symfony/process v4.4.4 requires php (^7.1.3) symfony/service-contracts v2.0.1 requires php (^7.2.5) ```
1 parent 8001af8 commit db97d73

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

.travis.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ jobs:
7777
dist: precise
7878
env: PHPCS_VERSION="2.0.0"
7979

80+
- php: nightly
81+
env: PHPCS_VERSION="dev-master" LINT=1
82+
83+
allow_failures:
84+
# Allow failures for unstable builds.
85+
- php: "nightly"
86+
8087
fast_finish: true
8188

8289
before_install:
@@ -93,7 +100,13 @@ install:
93100
# Install PHPCompatibility 8.x for PHPCS 2.2 < 2.3.
94101
composer require --no-update --no-suggest --no-scripts phpcompatibility/php-compatibility:"^8.0"
95102
fi
96-
- travis_wait composer install --no-interaction --no-progress --no-scripts --no-suggest --optimize-autoloader --prefer-dist --verbose
103+
- |
104+
if [[ $TRAVIS_PHP_VERSION != "nightly" ]]; then
105+
travis_wait composer install --no-interaction --no-progress --no-scripts --no-suggest --optimize-autoloader --prefer-dist --verbose
106+
else
107+
composer require --no-update --no-suggest --no-scripts phpcompatibility/php-compatibility
108+
travis_wait composer install --no-dev --no-interaction --no-progress --no-scripts --no-suggest --optimize-autoloader --prefer-dist --verbose --ignore-platform-reqs
109+
fi
97110
- |
98111
if [[ ${PHPCS_VERSION:0:3} < "2.2" ]]; then
99112
# Rename the PHPCompatibility directory as PHPCompatibility 7.x wasn't fully compatible with Composer yet.

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer"
2424
},
2525
"require": {
26-
"php": "^5.3|^7",
26+
"php": ">=5.3",
2727
"composer-plugin-api": "^1.0",
28-
"squizlabs/php_codesniffer": "^2|^3"
28+
"squizlabs/php_codesniffer": "^2 || ^3"
2929
},
3030
"require-dev": {
3131
"composer/composer": "*",

0 commit comments

Comments
 (0)