From 24801ed0e70401b06652126f9aaea8999ad03947 Mon Sep 17 00:00:00 2001 From: David Maicher Date: Mon, 9 Nov 2020 21:14:08 +0100 Subject: [PATCH] add support for php 8 (#4) --- .gitignore | 1 + .travis.yml | 12 ++++++++---- composer.json | 12 ++++++------ makefile | 13 ++++++++----- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 5c78898..fe61166 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ .php_cs.cache .phpunit.result.cache composer.lock +php-cs-fixer.phar diff --git a/.travis.yml b/.travis.yml index 9e8735e..3341681 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ php: env: - SYMFONY_REQUIRE="4.4.*" - - SYMFONY_REQUIRE="5.0.*" + - SYMFONY_REQUIRE="5.1.*" matrix: include: @@ -18,10 +18,12 @@ matrix: env: - SYMFONY_REQUIRE="4.4.*" - SOLARIUM_REQUIRE="^5.2" + - CS_FIXER=1 - - php: 7.4 + - php: nightly env: - SYMFONY_REQUIRE="5.1.*" + - STABILITY=dev before_install: - phpenv config-rm xdebug.ini || echo "xDebug not disabled" @@ -29,8 +31,10 @@ before_install: install: - rm -rf composer.lock vendor/* + - if [[ ${STABILITY} ]]; then composer config minimum-stability ${STABILITY}; fi; - if [[ ${SOLARIUM_REQUIRE} ]]; then composer req solarium/solarium $SOLARIUM_REQUIRE; fi - - composer update + - composer update --prefer-dist script: - - make build + - if [[ ${CS_FIXER} == "1" ]]; then make php_cs_fixer_check; fi + - make build diff --git a/composer.json b/composer.json index d6c2ea5..8d1b3f2 100644 --- a/composer.json +++ b/composer.json @@ -14,15 +14,15 @@ "sort-packages": true }, "require": { - "php": "^7.1", + "php": "^7.1 || ^8.0", "solarium/solarium": "^5.2 || ^6.0", - "symfony/framework-bundle": "^4.4 || ^5.0" + "symfony/framework-bundle": "^4.4 || ^5.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16", - "phpstan/phpstan": "^0.12.19", - "phpunit/phpunit": "^7.5 || ^8.5", - "symfony/phpunit-bridge": "^5.0" + "phpstan/phpstan": "^0.12", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", + "symfony/phpunit-bridge": "^5.1", + "symfony/stopwatch": "^4.4 || ^5.1" }, "autoload": { "psr-4": { diff --git a/makefile b/makefile index c2727f2..8120f28 100644 --- a/makefile +++ b/makefile @@ -4,10 +4,13 @@ test: phpstan: vendor/bin/phpstan analyse -c phpstan.neon -a vendor/autoload.php -l 5 src tests -build: test phpstan php_cs_fixer_check +build: test phpstan -php_cs_fixer_fix: - vendor/bin/php-cs-fixer fix --config .php_cs src tests +php_cs_fixer_fix: php-cs-fixer.phar + ./php-cs-fixer.phar fix --config .php_cs src tests -php_cs_fixer_check: - vendor/bin/php-cs-fixer fix --config .php_cs src tests --dry-run +php_cs_fixer_check: php-cs-fixer.phar + ./php-cs-fixer.phar fix --config .php_cs src tests --dry-run --diff --diff-format=udiff + +php-cs-fixer.phar: + wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.16.6/php-cs-fixer.phar && chmod 777 php-cs-fixer.phar