From 3a89f7ef096967046882a13d67f7997e6bc58e63 Mon Sep 17 00:00:00 2001 From: Matthieu Calie Date: Mon, 7 Dec 2020 17:45:23 +0100 Subject: [PATCH] Add PHP 8 support Also fixed the following items: - Fixed class not found warning on the Doctrine ObjectManager - Twig was locked to version 3.0 - updated travis.yaml file to support testing multiple symfony versions against multiple php versions - updated travis.yaml file: composer cache fixed --- .travis.yml | 43 ++++++++++++-------- Tests/Controller/HandshakeControllerTest.php | 2 +- Tests/Security/JWTAuthenticatorTest.php | 2 +- composer.json | 4 +- 4 files changed, 31 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 06aa1da..f62de81 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,31 +1,42 @@ language: php sudo: false -php: - - '7.3' +cache: + directories: + - $HOME/.composer/cache/files -env: - - SYMFONY_VERSION="3.4.*" - - SYMFONY_VERSION="4.3.*" - - SYMFONY_VERSION="4.4.*" - - SYMFONY_VERSION="5.0.*" +matrix: + fast_finish: true + include: + - php: 7.3 + env: SYMFONY_VERSION="3.4.*" + - php: 7.3 + env: SYMFONY_VERSION="4.4.*" + - php: 7.3 + env: SYMFONY_VERSION="5.1.*" + - php: 7.3 + env: SYMFONY_VERSION="5.2.*" + - php: 7.4 + env: SYMFONY_VERSION="3.4.*" + - php: 7.4 + env: SYMFONY_VERSION="4.4.*" + - php: 7.4 + env: SYMFONY_VERSION="5.1.*" + - php: 7.4 + env: SYMFONY_VERSION="5.2.*" + - php: 8.0 + env: SYMFONY_VERSION="5.2.*" COMPOSER_FLAGS="--ignore-platform-reqs" -before_script: - - composer self-update - - sed -i -e "s/\^3\.4[|]\^4\.3[|]\^5\.0/$SYMFONY_VERSION/g" composer.json - - composer install --dev --prefer-dist --no-interaction -o +install: + - composer require --prefer-dist --no-interaction ${COMPOSER_FLAGS} symfony/symfony:${SYMFONY_VERSION} script: - ./vendor/bin/phpcs -p --standard=./ruleset.xml - - ./vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover=coverage.xml + - XDEBUG_MODE=coverage ./vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover=coverage.xml after_success: - bash <(curl -s https://codecov.io/bash) -cache: - directories: - - $COMPOSER_CACHE_DIR - notifications: email: - vitaliy.zurian@gmail.com diff --git a/Tests/Controller/HandshakeControllerTest.php b/Tests/Controller/HandshakeControllerTest.php index 422f1c8..6ca39e4 100644 --- a/Tests/Controller/HandshakeControllerTest.php +++ b/Tests/Controller/HandshakeControllerTest.php @@ -4,8 +4,8 @@ use AtlassianConnectBundle\Controller\HandshakeController; use AtlassianConnectBundle\Entity\Tenant; -use Doctrine\Common\Persistence\ObjectRepository; use Doctrine\ORM\EntityManagerInterface; +use Doctrine\Persistence\ObjectRepository; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Log\Logger; diff --git a/Tests/Security/JWTAuthenticatorTest.php b/Tests/Security/JWTAuthenticatorTest.php index eedb43e..7a1808c 100644 --- a/Tests/Security/JWTAuthenticatorTest.php +++ b/Tests/Security/JWTAuthenticatorTest.php @@ -5,8 +5,8 @@ use AtlassianConnectBundle\Entity\Tenant; use AtlassianConnectBundle\Security\JWTAuthenticator; use AtlassianConnectBundle\Security\JWTUserProviderInterface; -use Doctrine\Common\Persistence\ObjectRepository; use Doctrine\ORM\EntityManagerInterface; +use Doctrine\Persistence\ObjectRepository; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request; diff --git a/composer.json b/composer.json index 0975b5a..b2ff7d8 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "type": "symfony-bundle", "license": "MIT", "require": { - "php": "^7.2", + "php": "^7.2|^8.0", "ext-json": "*", "symfony/dependency-injection": "^3.4|^4.3|^5.0", "symfony/http-kernel": "^3.4|^4.3|^5.0", @@ -18,7 +18,7 @@ "symfony/console": "^3.4|^4.3|^5.0", "doctrine/orm": "^2.5", "guzzlehttp/guzzle": "^6.0", - "twig/twig": "^2.10|3.0", + "twig/twig": "^2.10|^3.0", "firebase/php-jwt": "^5.0" }, "require-dev": {