vendor/sylius/rbac-plugin/src/DependencyInjection/Configuration.php line 18

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Sylius\RbacPlugin\DependencyInjection;
  4. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  5. use Symfony\Component\Config\Definition\ConfigurationInterface;
  6. final class Configuration implements ConfigurationInterface
  7. {
  8.     /**
  9.      * {@inheritdoc}
  10.      */
  11.     public function getConfigTreeBuilder(): TreeBuilder
  12.     {
  13.         $treeBuilder = new TreeBuilder();
  14.         $rootNode $treeBuilder->root('sylius_rbac');
  15.         $rootNode
  16.             ->addDefaultsIfNotSet()
  17.             ->children()
  18.                 ->arrayNode('sylius_sections')
  19.                     ->children()
  20.                         ->arrayNode('catalog')->variablePrototype()->end()->end()
  21.                         ->arrayNode('configuration')->variablePrototype()->end()->end()
  22.                         ->arrayNode('customers')->variablePrototype()->end()->end()
  23.                         ->arrayNode('marketing')->variablePrototype()->end()->end()
  24.                         ->arrayNode('sales')->variablePrototype()->end()->end()
  25.                     ->end()
  26.                 ->end()
  27.             ->end()
  28.             ->children()
  29.                 /* it's a very MVP approach, as now we can pass almost everything there
  30.                    TODO: create some more strict custom sections structure */
  31.                 ->arrayNode('custom_sections')
  32.                     ->useAttributeAsKey('name')
  33.                     ->variablePrototype()
  34.                 ->end()
  35.             ->end()
  36.         ;
  37.         return $treeBuilder;
  38.     }
  39. }