Skip to content

Commit c5d38ed

Browse files
authored
Merge pull request #340 from php-http/php-version
Cleanup PHP version and Symfony version support
2 parents bad3276 + 6f52503 commit c5d38ed

File tree

5 files changed

+37
-25
lines changed

5 files changed

+37
-25
lines changed

.travis.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,15 @@ matrix:
2222
include:
2323
# Minimum supported Symfony version and latest PHP version
2424
- php: 7.3
25-
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak" SYMFONY_PHPUNIT_VERSION="5.7"
25+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak"
2626

2727
# Test the latest stable release
28-
- php: 5.5
29-
env: SYMFONY_PHPUNIT_VERSION="5.7"
30-
- php: 5.6
31-
env: SYMFONY_PHPUNIT_VERSION="5.7"
32-
- php: 7.0
3328
- php: 7.1
3429
- php: 7.2
3530
- php: 7.3
3631
env: COVERAGE=true TEST_COMMAND="composer test-ci"
3732

3833
# Test LTS versions
39-
- php: 7.3
40-
env: DEPENDENCIES="dunglas/symfony-lock:^2"
4134
- php: 7.3
4235
env: DEPENDENCIES="dunglas/symfony-lock:^3"
4336
- php: 7.3

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
44

5+
## 1.16.0 - unreleased
6+
7+
### Changed
8+
9+
- Dropped support for PHP < 7.1
10+
- Dropped support for Symfony 2
11+
512
### Added
613

714
- Integration for VCR Plugin

composer.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^5.5 || ^7.0",
19+
"php": "^7.1",
2020
"php-http/client-common": "^1.9 || ^2.0",
2121
"php-http/client-implementation": "^1.0",
2222
"php-http/discovery": "^1.0",
@@ -26,31 +26,31 @@
2626
"php-http/message-factory": "^1.0.2",
2727
"php-http/stopwatch-plugin": "^1.2",
2828
"psr/http-message": "^1.0",
29-
"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",
30-
"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",
31-
"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",
32-
"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",
33-
"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"
29+
"symfony/config": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
30+
"symfony/dependency-injection": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
31+
"symfony/event-dispatcher": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
32+
"symfony/http-kernel": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
33+
"symfony/options-resolver": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1"
3434
},
3535
"require-dev": {
3636
"guzzlehttp/psr7": "^1.0",
37-
"matthiasnoback/symfony-dependency-injection-test": "^1.1 || ^2.3",
37+
"matthiasnoback/symfony-dependency-injection-test": "^3.0",
3838
"nyholm/nsa": "^1.1",
3939
"php-http/cache-plugin": "^1.6",
4040
"php-http/guzzle6-adapter": "^1.1.1 || ^2.0.1",
4141
"php-http/mock-client": "^1.2",
4242
"php-http/promise": "^1.0",
4343
"php-http/vcr-plugin": "^1.0@dev",
4444
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
45-
"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",
46-
"symfony/cache": "^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
47-
"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",
48-
"symfony/framework-bundle": "^2.8.1 || ^3.0.1 || ^4.0",
49-
"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",
45+
"symfony/browser-kit": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
46+
"symfony/cache": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
47+
"symfony/dom-crawler": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
48+
"symfony/framework-bundle": "^3.4.0 || ^4.0",
49+
"symfony/http-foundation": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
5050
"symfony/phpunit-bridge": "^3.4 || ^4.2",
51-
"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",
52-
"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",
53-
"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",
51+
"symfony/stopwatch": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
52+
"symfony/twig-bundle": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
53+
"symfony/web-profiler-bundle": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
5454
"twig/twig": "^1.36 || ^2.6"
5555
},
5656
"conflict": {

src/DependencyInjection/Configuration.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,14 @@ private function createCachePluginNode()
768768
->end()
769769
;
770770

771-
$cache = $builder->root('cache');
771+
$treeBuilder = new TreeBuilder('cache');
772+
// Keep compatibility with symfony/config < 4.2
773+
if (!method_exists($treeBuilder, 'getRootNode')) {
774+
$cache = $treeBuilder->root('cache');
775+
} else {
776+
$cache = $treeBuilder->getRootNode();
777+
}
778+
772779
$cache
773780
->canBeEnabled()
774781
->info('Configure HTTP caching, requires the php-http/cache-plugin package')

tests/Functional/ServiceInstantiationTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Symfony\Component\HttpFoundation\Request;
1818
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
1919
use Symfony\Component\HttpKernel\HttpKernelInterface;
20+
use Symfony\Component\HttpKernel\Kernel;
2021
use Symfony\Component\HttpKernel\KernelEvents;
2122
use Symfony\Component\HttpKernel\Profiler\Profiler;
2223

@@ -113,7 +114,11 @@ protected static function bootKernel(array $options = [])
113114

114115
$event = new GetResponseEvent(static::$kernel, new Request(), HttpKernelInterface::MASTER_REQUEST);
115116

116-
$dispatcher->dispatch(KernelEvents::REQUEST, $event);
117+
if (version_compare(Kernel::VERSION, '4.3.0', '>=')) {
118+
$dispatcher->dispatch($event, KernelEvents::REQUEST);
119+
} else {
120+
$dispatcher->dispatch(KernelEvents::REQUEST, $event);
121+
}
117122

118123
return static::$kernel;
119124
}

0 commit comments

Comments
 (0)