This repository was archived by the owner on Feb 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313
1414namespace Nucleos \GDPRBundle \DependencyInjection ;
1515
16- use Symfony \Component \Config \Definition \Builder \ArrayNodeDefinition ;
16+ use Symfony \Component \Config \Definition \Builder \NodeDefinition ;
1717use Symfony \Component \Config \Definition \Builder \TreeBuilder ;
1818use Symfony \Component \Config \Definition \ConfigurationInterface ;
1919
@@ -24,25 +24,24 @@ public function getConfigTreeBuilder()
2424 $ treeBuilder = new TreeBuilder ('nucleos_gdpr ' );
2525
2626 $ rootNode = $ treeBuilder ->getRootNode ();
27-
28- $ this ->addBlockCookiesSection ($ rootNode );
27+ $ rootNode ->append ($ this ->getBlockCookiesNode ());
2928
3029 return $ treeBuilder ;
3130 }
3231
33- private function addBlockCookiesSection ( ArrayNodeDefinition $ node ): void
32+ private function getBlockCookiesNode ( ): NodeDefinition
3433 {
34+ $ node = (new TreeBuilder ('block_cookies ' ))->getRootNode ();
35+
3536 $ node
3637 ->children ()
37- ->arrayNode ('block_cookies ' )
38- ->children ()
39- ->arrayNode ('keep ' )
40- ->defaultValue (['PHPSESSID ' ])
41- ->prototype ('scalar ' )->end ()
42- ->end ()
43- ->end ()
38+ ->arrayNode ('keep ' )
39+ ->defaultValue (['PHPSESSID ' ])
40+ ->prototype ('scalar ' )->end ()
4441 ->end ()
4542 ->end ()
4643 ;
44+
45+ return $ node ;
4746 }
4847}
You can’t perform that action at this time.
0 commit comments