Skip to content

Commit

Permalink
Merge pull request #340 from php-http/php-version
Browse files Browse the repository at this point in the history
Cleanup PHP version and Symfony version support
  • Loading branch information
dbu committed Jun 4, 2019
2 parents bad3276 + 6f52503 commit c5d38ed
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 25 deletions.
9 changes: 1 addition & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 15 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -26,31 +26,31 @@
"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",
"php-http/mock-client": "^1.2",
"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": {
Expand Down
9 changes: 8 additions & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
7 changes: 6 additions & 1 deletion tests/Functional/ServiceInstantiationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit c5d38ed

Please sign in to comment.