vendor/emanueleminotto/twig-cache-bundle/DependencyInjection/Configuration.php line 23

Open in your IDE?
  1. <?php
  2. namespace EmanueleMinotto\TwigCacheBundle\DependencyInjection;
  3. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  4. use Symfony\Component\Config\Definition\ConfigurationInterface;
  5. /**
  6.  * This class validates and merges configuration from your app files.
  7.  *
  8.  * @see http://symfony.com/doc/current/cookbook/bundles/extension.html
  9.  */
  10. class Configuration implements ConfigurationInterface
  11. {
  12.     /**
  13.      * Generates the configuration tree builder.
  14.      *
  15.      * @return TreeBuilder the tree builder
  16.      */
  17.     public function getConfigTreeBuilder()
  18.     {
  19.         $treeBuilder = new TreeBuilder();
  20.         $rootNode $treeBuilder->root('twig_cache');
  21.         $rootNode
  22.             ->children()
  23.                 ->booleanNode('profiler')
  24.                     ->defaultValue('%kernel.debug%')
  25.                 ->end()
  26.                 ->scalarNode('service')
  27.                     ->cannotBeEmpty()
  28.                     ->isRequired()
  29.                 ->end()
  30.                 ->scalarNode('strategy')
  31.                     ->cannotBeEmpty()
  32.                     ->defaultValue('twig_cache.strategy')
  33.                 ->end()
  34.                 ->scalarNode('key_generator')
  35.                     ->cannotBeEmpty()
  36.                     ->defaultValue('twig_cache.strategy.spl_object_hash_key_generator')
  37.                     ->info('service id that implements KeyGeneratorInterface to generate a key for template cache')
  38.                 ->end()
  39.             ->end();
  40.         return $treeBuilder;
  41.     }
  42. }