diff --git a/.travis.yml b/.travis.yml index 704ae61c..48dad698 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,22 +22,15 @@ matrix: include: # Minimum supported Symfony version and latest PHP version - php: 7.3 - env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak" SYMFONY_PHPUNIT_VERSION="5.7" + env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak" # Test the latest stable release - - php: 5.5 - env: SYMFONY_PHPUNIT_VERSION="5.7" - - php: 5.6 - env: SYMFONY_PHPUNIT_VERSION="5.7" - - php: 7.0 - php: 7.1 - php: 7.2 - php: 7.3 env: COVERAGE=true TEST_COMMAND="composer test-ci" # Test LTS versions - - php: 7.3 - env: DEPENDENCIES="dunglas/symfony-lock:^2" - php: 7.3 env: DEPENDENCIES="dunglas/symfony-lock:^3" - php: 7.3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 07f76616..27360216 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 1.16.0 - unreleased + +### Changed + +- Dropped support for PHP < 7.1 +- Dropped support for Symfony 2 + ### Added - Integration for VCR Plugin diff --git a/composer.json b/composer.json index 479bea70..018dd1be 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": "^5.5 || ^7.0", + "php": "^7.1", "php-http/client-common": "^1.9 || ^2.0", "php-http/client-implementation": "^1.0", "php-http/discovery": "^1.0", @@ -26,15 +26,15 @@ "php-http/message-factory": "^1.0.2", "php-http/stopwatch-plugin": "^1.2", "psr/http-message": "^1.0", - "symfony/config": "^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", - "symfony/dependency-injection": "^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", - "symfony/event-dispatcher": "^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", - "symfony/http-kernel": "^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", - "symfony/options-resolver": "^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1" + "symfony/config": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", + "symfony/dependency-injection": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", + "symfony/event-dispatcher": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", + "symfony/http-kernel": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", + "symfony/options-resolver": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1" }, "require-dev": { "guzzlehttp/psr7": "^1.0", - "matthiasnoback/symfony-dependency-injection-test": "^1.1 || ^2.3", + "matthiasnoback/symfony-dependency-injection-test": "^3.0", "nyholm/nsa": "^1.1", "php-http/cache-plugin": "^1.6", "php-http/guzzle6-adapter": "^1.1.1 || ^2.0.1", @@ -42,15 +42,15 @@ "php-http/promise": "^1.0", "php-http/vcr-plugin": "^1.0@dev", "polishsymfonycommunity/symfony-mocker-container": "^1.0", - "symfony/browser-kit": "^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", - "symfony/cache": "^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", - "symfony/dom-crawler": "^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", - "symfony/framework-bundle": "^2.8.1 || ^3.0.1 || ^4.0", - "symfony/http-foundation": "^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", + "symfony/browser-kit": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", + "symfony/cache": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", + "symfony/dom-crawler": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", + "symfony/framework-bundle": "^3.4.0 || ^4.0", + "symfony/http-foundation": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", "symfony/phpunit-bridge": "^3.4 || ^4.2", - "symfony/stopwatch": "^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", - "symfony/twig-bundle": "^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", - "symfony/web-profiler-bundle": "^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", + "symfony/stopwatch": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", + "symfony/twig-bundle": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", + "symfony/web-profiler-bundle": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", "twig/twig": "^1.36 || ^2.6" }, "conflict": { diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index d5027de4..f2982d35 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -768,7 +768,14 @@ private function createCachePluginNode() ->end() ; - $cache = $builder->root('cache'); + $treeBuilder = new TreeBuilder('cache'); + // Keep compatibility with symfony/config < 4.2 + if (!method_exists($treeBuilder, 'getRootNode')) { + $cache = $treeBuilder->root('cache'); + } else { + $cache = $treeBuilder->getRootNode(); + } + $cache ->canBeEnabled() ->info('Configure HTTP caching, requires the php-http/cache-plugin package') diff --git a/tests/Functional/ServiceInstantiationTest.php b/tests/Functional/ServiceInstantiationTest.php index 71852e04..3ebecb1a 100644 --- a/tests/Functional/ServiceInstantiationTest.php +++ b/tests/Functional/ServiceInstantiationTest.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Profiler\Profiler; @@ -113,7 +114,11 @@ protected static function bootKernel(array $options = []) $event = new GetResponseEvent(static::$kernel, new Request(), HttpKernelInterface::MASTER_REQUEST); - $dispatcher->dispatch(KernelEvents::REQUEST, $event); + if (version_compare(Kernel::VERSION, '4.3.0', '>=')) { + $dispatcher->dispatch($event, KernelEvents::REQUEST); + } else { + $dispatcher->dispatch(KernelEvents::REQUEST, $event); + } return static::$kernel; }