vendor/wearemarketing/routingbundle/DependencyInjection/Configuration.php line 26

Open in your IDE?
  1. <?php
  2. namespace WAM\Bundle\RoutingBundle\DependencyInjection;
  3. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  4. use Symfony\Component\Config\Definition\ConfigurationInterface;
  5. use WAM\Bundle\RoutingBundle\Entity\AutoRoute;
  6. use WAM\Bundle\RoutingBundle\Entity\Url;
  7. /**
  8.  * Class Configuration.
  9.  *
  10.  * @author David Velasco <dvelasco@wearemarketing.com>
  11.  */
  12. class Configuration implements ConfigurationInterface
  13. {
  14.     const ROUTING_BREADCRUMB 'WAM\Bundle\RoutingBundle\Model\RoutingBreadcrumb';
  15.     const DEFAULT_SEPARATOR ' / ';
  16.     const DEFAULT_VERSION 'complete_version';
  17.     const DEFAULT_DEAD_LINK_PERMANENT true;
  18.     public function getConfigTreeBuilder()
  19.     {
  20.         $treeBuilder = new TreeBuilder();
  21.         $treeBuilder->root('wam_routing')
  22.             ->children()
  23.                 ->variableNode('version')
  24.                     ->defaultValue(self::DEFAULT_VERSION)
  25.                 ->end()
  26.                 ->arrayNode('breadcrumb')
  27.                     ->addDefaultsIfNotSet()
  28.                         ->children()
  29.                             ->scalarNode('separator')->cannotBeEmpty()->defaultValue(self::DEFAULT_SEPARATOR)->end()
  30.                             ->arrayNode('classes')->defaultValue([self::ROUTING_BREADCRUMB])
  31.                             ->prototype('scalar')->end()
  32.                         ->end()
  33.                     ->end()
  34.                 ->end()
  35.                 ->scalarNode('route_class')->defaultValue(AutoRoute::class)->end()
  36.                 ->scalarNode('url_class')->isRequired()->end()
  37.                 ->arrayNode('dead_links')
  38.                     ->canBeEnabled()
  39.                         ->addDefaultsIfNotSet()
  40.                             ->children()
  41.                                 ->arrayNode('classes')
  42.                                 ->prototype('array')
  43.                                     ->children()
  44.                                         ->scalarNode('class')->end()
  45.                                         ->scalarNode('redirect_to_route')->end()
  46.                                         ->booleanNode('permanent')->treatNullLike(true)->end()
  47.                                     ->end()
  48.                                 ->end()
  49.                             ->end()
  50.                             ->scalarNode('fallback_redirect_to_route')->defaultNull()->end()
  51.                             ->scalarNode('fallback_permanent')->cannotBeEmpty()->defaultValue(self::DEFAULT_DEAD_LINK_PERMANENT)->end()
  52.                         ->end()
  53.                     ->end()
  54.                 ->end()
  55.             ->end();
  56.         return $treeBuilder;
  57.     }
  58. }