From 39946b45b4d54168e766b668ea34273a6f878659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petar=20=C5=A0panja?= Date: Fri, 28 Jun 2024 08:04:15 +0200 Subject: [PATCH] NGSTACK-842: apply null-safe chaining to account for config builder API deficiencies --- bundle/DependencyInjection/Configuration.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bundle/DependencyInjection/Configuration.php b/bundle/DependencyInjection/Configuration.php index 62305de..7d9794c 100644 --- a/bundle/DependencyInjection/Configuration.php +++ b/bundle/DependencyInjection/Configuration.php @@ -41,7 +41,7 @@ private function addEnabled(ArrayNodeDefinition $nodeDefinition): void ->booleanNode('enabled') ->defaultFalse() ->end() - ->end(); + ?->end(); } private function addHandlerSection(ArrayNodeDefinition $nodeDefinition): void @@ -52,7 +52,7 @@ private function addHandlerSection(ArrayNodeDefinition $nodeDefinition): void ->info('Configure handler for scheduled visibility mechanism') ->defaultValue('content') ->end() - ->end(); + ?->end(); } private function addContentTypesSection(ArrayNodeDefinition $nodeDefinition): void @@ -69,10 +69,10 @@ private function addContentTypesSection(ArrayNodeDefinition $nodeDefinition): vo ->booleanNode('all') ->defaultFalse() ->end() - ->arrayNode('allowed') + ?->arrayNode('allowed') ->scalarPrototype() ->end() - ->end() + ?->end() ->end() ->end(); } @@ -92,7 +92,7 @@ private function addSectionsSection(ArrayNodeDefinition $nodeDefinition): void ->integerNode('section_id') ->defaultValue(0) ->end() - ->end() + ?->end() ->end() ->arrayNode('hidden') ->info('Configure hidden section id used for scheduled visibility mechanism') @@ -101,7 +101,7 @@ private function addSectionsSection(ArrayNodeDefinition $nodeDefinition): void ->integerNode('section_id') ->defaultValue(0) ->end() - ->end() + ?->end() ->end() ->end() ->end() @@ -119,14 +119,14 @@ private function addObjectStatesSection(ArrayNodeDefinition $nodeDefinition): vo ->integerNode('object_state_group_id') ->defaultValue(0) ->end() - ->arrayNode('visible') + ?->arrayNode('visible') ->info('Configure visible object states and groups used for scheduled visibility mechanism') ->addDefaultsIfNotSet() ->children() ->integerNode('object_state_id') ->defaultValue(0) ->end() - ->end() + ?->end() ->end() ->arrayNode('hidden') ->info('Configure hidden bject states and groups used for scheduled visibility mechanism') @@ -135,7 +135,7 @@ private function addObjectStatesSection(ArrayNodeDefinition $nodeDefinition): vo ->integerNode('object_state_id') ->defaultValue(0) ->end() - ->end() + ?->end() ->end() ->end() ->end()