vendor/willdurand/hateoas-bundle/DependencyInjection/Configuration.php line 29

Open in your IDE?
  1. <?php
  2. /**
  3.  * This file is part of the HateoasBundle package.
  4.  * For the full copyright and license information, please view the LICENSE
  5.  * file that was distributed with this source code.
  6.  *
  7.  * @license    MIT License
  8.  */
  9. namespace Bazinga\Bundle\HateoasBundle\DependencyInjection;
  10. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  11. use Symfony\Component\Config\Definition\ConfigurationInterface;
  12. /**
  13.  * @author William Durand <[email protected]>
  14.  */
  15. class Configuration implements ConfigurationInterface
  16. {
  17.     /**
  18.      * Generates the configuration tree builder.
  19.      *
  20.      * @return TreeBuilder The tree builder
  21.      */
  22.     public function getConfigTreeBuilder()
  23.     {
  24.         $treeBuilder = new TreeBuilder();
  25.         $rootNode    $treeBuilder->root('bazinga_hateoas');
  26.         $rootNode
  27.             ->children()
  28.             ->arrayNode('metadata')
  29.                 ->addDefaultsIfNotSet()
  30.                 ->children()
  31.                     ->scalarNode('cache')->defaultValue('file')->end()
  32.                     ->arrayNode('file_cache')
  33.                         ->addDefaultsIfNotSet()
  34.                         ->children()
  35.                             ->scalarNode('dir')->defaultValue('%kernel.cache_dir%/hateoas')->end()
  36.                         ->end()
  37.                     ->end()
  38.                 ->end()
  39.             ->end()
  40.             ->arrayNode('serializer')
  41.                 ->addDefaultsIfNotSet()
  42.                 ->children()
  43.                     ->scalarNode('json')->defaultValue('hateoas.serializer.json_hal')->end()
  44.                     ->scalarNode('xml')->defaultValue('hateoas.serializer.xml')->end()
  45.                 ->end()
  46.             ->end()
  47.             ->arrayNode('twig_extension')
  48.                 ->addDefaultsIfNotSet()
  49.                 ->canBeDisabled()
  50.             ->end()
  51.         ;
  52.         return $treeBuilder;
  53.     }
  54. }