Skip to content

Commit d3956d7

Browse files
committed
drop support for unmaintained Symfony versions
1 parent 961cc9c commit d3956d7

File tree

3 files changed

+19
-48
lines changed

3 files changed

+19
-48
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee
77
### Changed
88

99
- Dropped support for PHP < 7.1
10-
- Dropped support for Symfony 2
10+
- Dropped support for Symfony versions that do not receive bugfixes
1111

1212
### Added
1313

composer.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
"php-http/message-factory": "^1.0.2",
3636
"php-http/stopwatch-plugin": "^1.2",
3737
"psr/http-message": "^1.0",
38-
"symfony/config": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
39-
"symfony/dependency-injection": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
40-
"symfony/event-dispatcher": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
41-
"symfony/http-kernel": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
42-
"symfony/options-resolver": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1"
38+
"symfony/config": "^3.4.20 || ^4.2.1",
39+
"symfony/dependency-injection": "^3.4.20 || ^4.2.1",
40+
"symfony/event-dispatcher": "^3.4.20 || ^4.2.1",
41+
"symfony/http-kernel": "^3.4.20 || ^4.2.1",
42+
"symfony/options-resolver": "^3.4.20 || ^4.2.1"
4343
},
4444
"conflict": {
4545
"php-http/guzzle6-adapter": "<1.1"
@@ -54,15 +54,15 @@
5454
"php-http/promise": "^1.0",
5555
"php-http/vcr-plugin": "^1.0@dev",
5656
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
57-
"symfony/browser-kit": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
58-
"symfony/cache": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
59-
"symfony/dom-crawler": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
60-
"symfony/framework-bundle": "^3.4.0 || ^4.0",
61-
"symfony/http-foundation": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
57+
"symfony/browser-kit": "^3.4.20 || ^4.2.1",
58+
"symfony/cache": "^3.4.20 || ^4.2.1",
59+
"symfony/dom-crawler": "^3.4.20 || ^4.2.1",
60+
"symfony/framework-bundle": "^3.4.0 || ^4.2",
61+
"symfony/http-foundation": "^3.4.20 || ^4.2.1",
6262
"symfony/phpunit-bridge": "^3.4 || ^4.2",
63-
"symfony/stopwatch": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
64-
"symfony/twig-bundle": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
65-
"symfony/web-profiler-bundle": "^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",
63+
"symfony/stopwatch": "^3.4.20 || ^4.2.1",
64+
"symfony/twig-bundle": "^3.4.20 || ^4.2.1",
65+
"symfony/web-profiler-bundle": "^3.4.20 || ^4.2.1",
6666
"twig/twig": "^1.36 || ^2.6"
6767
},
6868
"suggest": {

src/DependencyInjection/Configuration.php

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,7 @@ public function __construct($debug)
5454
public function getConfigTreeBuilder()
5555
{
5656
$treeBuilder = new TreeBuilder('httplug');
57-
// Keep compatibility with symfony/config < 4.2
58-
if (!method_exists($treeBuilder, 'getRootNode')) {
59-
$rootNode = $treeBuilder->root('httplug');
60-
} else {
61-
$rootNode = $treeBuilder->getRootNode();
62-
}
57+
$rootNode = $treeBuilder->getRootNode();
6358

6459
$this->configureClients($rootNode);
6560
$this->configureSharedPlugins($rootNode);
@@ -260,15 +255,9 @@ private function configureSharedPlugins(ArrayNodeDefinition $root)
260255
private function createClientPluginNode()
261256
{
262257
$treeBuilder = new TreeBuilder('plugins');
263-
// Keep compatibility with symfony/config < 4.2
264-
if (!method_exists($treeBuilder, 'getRootNode')) {
265-
$node = $treeBuilder->root('plugins');
266-
} else {
267-
$node = $treeBuilder->getRootNode();
268-
}
269258

270259
/** @var ArrayNodeDefinition $pluginList */
271-
$pluginList = $node
260+
$pluginList = $treeBuilder->getRootNode()
272261
->info('A list of plugin service ids and client specific plugin definitions. The order is important.')
273262
->prototype('array')
274263
;
@@ -596,14 +585,8 @@ private function addSharedPluginNodes(ArrayNodeDefinition $pluginNode, $disableA
596585
private function createAuthenticationPluginNode()
597586
{
598587
$treeBuilder = new TreeBuilder('authentication');
599-
// Keep compatibility with symfony/config < 4.2
600-
if (!method_exists($treeBuilder, 'getRootNode')) {
601-
$node = $treeBuilder->root('authentication');
602-
} else {
603-
$node = $treeBuilder->getRootNode();
604-
}
605588

606-
$node
589+
$treeBuilder->getRootNode()
607590
->useAttributeAsKey('name')
608591
->prototype('array')
609592
->validate()
@@ -693,14 +676,8 @@ private function validateAuthenticationType(array $expected, array $actual, $aut
693676
private function createCachePluginNode()
694677
{
695678
$builder = new TreeBuilder('config');
696-
// Keep compatibility with symfony/config < 4.2
697-
if (!method_exists($builder, 'getRootNode')) {
698-
$config = $builder->root('config');
699-
} else {
700-
$config = $builder->getRootNode();
701-
}
702679

703-
$config
680+
$builder->getRootNode()
704681
->fixXmlConfig('method')
705682
->fixXmlConfig('respect_response_cache_directive')
706683
->addDefaultsIfNotSet()
@@ -769,14 +746,8 @@ private function createCachePluginNode()
769746
;
770747

771748
$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-
}
778749

779-
$cache
750+
$treeBuilder->getRootNode()
780751
->canBeEnabled()
781752
->info('Configure HTTP caching, requires the php-http/cache-plugin package')
782753
->addDefaultsIfNotSet()

0 commit comments

Comments
 (0)