@@ -54,12 +54,7 @@ public function __construct($debug)
54
54
public function getConfigTreeBuilder ()
55
55
{
56
56
$ 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 ();
63
58
64
59
$ this ->configureClients ($ rootNode );
65
60
$ this ->configureSharedPlugins ($ rootNode );
@@ -260,15 +255,9 @@ private function configureSharedPlugins(ArrayNodeDefinition $root)
260
255
private function createClientPluginNode ()
261
256
{
262
257
$ 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
- }
269
258
270
259
/** @var ArrayNodeDefinition $pluginList */
271
- $ pluginList = $ node
260
+ $ pluginList = $ treeBuilder -> getRootNode ()
272
261
->info ('A list of plugin service ids and client specific plugin definitions. The order is important. ' )
273
262
->prototype ('array ' )
274
263
;
@@ -596,14 +585,8 @@ private function addSharedPluginNodes(ArrayNodeDefinition $pluginNode, $disableA
596
585
private function createAuthenticationPluginNode ()
597
586
{
598
587
$ 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
- }
605
588
606
- $ node
589
+ $ treeBuilder -> getRootNode ()
607
590
->useAttributeAsKey ('name ' )
608
591
->prototype ('array ' )
609
592
->validate ()
@@ -693,14 +676,8 @@ private function validateAuthenticationType(array $expected, array $actual, $aut
693
676
private function createCachePluginNode ()
694
677
{
695
678
$ 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
- }
702
679
703
- $ config
680
+ $ builder -> getRootNode ()
704
681
->fixXmlConfig ('method ' )
705
682
->fixXmlConfig ('respect_response_cache_directive ' )
706
683
->addDefaultsIfNotSet ()
@@ -769,14 +746,8 @@ private function createCachePluginNode()
769
746
;
770
747
771
748
$ 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
749
779
- $ cache
750
+ $ treeBuilder -> getRootNode ()
780
751
->canBeEnabled ()
781
752
->info ('Configure HTTP caching, requires the php-http/cache-plugin package ' )
782
753
->addDefaultsIfNotSet ()
0 commit comments