vendor/alterphp/easyadmin-extension-bundle/src/DependencyInjection/Configuration.php line 20

Open in your IDE?
  1. <?php
  2. namespace AlterPHP\EasyAdminExtensionBundle\DependencyInjection;
  3. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  4. use Symfony\Component\Config\Definition\ConfigurationInterface;
  5. /**
  6.  * This is the class that validates and merges configuration from your app/config files.
  7.  *
  8.  * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/configuration.html}
  9.  */
  10. class Configuration implements ConfigurationInterface
  11. {
  12.     /**
  13.      * {@inheritdoc}
  14.      */
  15.     public function getConfigTreeBuilder()
  16.     {
  17.         $treeBuilder = new TreeBuilder();
  18.         $rootNode $treeBuilder->root('easy_admin_extension');
  19.         $rootNode
  20.             ->children()
  21.                 ->arrayNode('custom_form_types')
  22.                     ->useAttributeAsKey('short_name')
  23.                     ->prototype('scalar')
  24.                         ->validate()
  25.                             ->ifTrue(function ($v) {
  26.                                 return !\class_exists($v);
  27.                             })
  28.                                 ->thenInvalid('Class %s for custom type does not exist !')
  29.                         ->end()
  30.                     ->end()
  31.                 ->end()
  32.                 ->scalarNode('minimum_role')
  33.                     ->defaultNull()
  34.                 ->end()
  35.                 ->arrayNode('embedded_list')
  36.                     ->addDefaultsIfNotSet()
  37.                     ->children()
  38.                         ->booleanNode('open_new_tab')
  39.                             ->defaultTrue()
  40.                         ->end()
  41.                     ->end()
  42.                 ->end()
  43.             ->end()
  44.         ;
  45.         return $treeBuilder;
  46.     }
  47. }