Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / config / Tests / Fixtures / Configuration / ExampleConfiguration.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Config\Tests\Fixtures\Configuration;
13
14 use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15 use Symfony\Component\Config\Definition\ConfigurationInterface;
16
17 class ExampleConfiguration implements ConfigurationInterface
18 {
19     public function getConfigTreeBuilder()
20     {
21         $treeBuilder = new TreeBuilder();
22         $rootNode = $treeBuilder->root('acme_root');
23
24         $rootNode
25             ->fixXmlConfig('parameter')
26             ->fixXmlConfig('connection')
27             ->fixXmlConfig('cms_page')
28             ->children()
29                 ->booleanNode('boolean')->defaultTrue()->end()
30                 ->scalarNode('scalar_empty')->end()
31                 ->scalarNode('scalar_null')->defaultNull()->end()
32                 ->scalarNode('scalar_true')->defaultTrue()->end()
33                 ->scalarNode('scalar_false')->defaultFalse()->end()
34                 ->scalarNode('scalar_default')->defaultValue('default')->end()
35                 ->scalarNode('scalar_array_empty')->defaultValue(array())->end()
36                 ->scalarNode('scalar_array_defaults')->defaultValue(array('elem1', 'elem2'))->end()
37                 ->scalarNode('scalar_required')->isRequired()->end()
38                 ->scalarNode('node_with_a_looong_name')->end()
39                 ->enumNode('enum_with_default')->values(array('this', 'that'))->defaultValue('this')->end()
40                 ->enumNode('enum')->values(array('this', 'that'))->end()
41                 ->arrayNode('array')
42                     ->info('some info')
43                     ->canBeUnset()
44                     ->children()
45                         ->scalarNode('child1')->end()
46                         ->scalarNode('child2')->end()
47                         ->scalarNode('child3')
48                             ->info(
49                                 "this is a long\n".
50                                 "multi-line info text\n".
51                                 'which should be indented'
52                             )
53                             ->example('example setting')
54                         ->end()
55                     ->end()
56                 ->end()
57                 ->arrayNode('scalar_prototyped')
58                     ->prototype('scalar')->end()
59                 ->end()
60                 ->arrayNode('parameters')
61                     ->useAttributeAsKey('name')
62                     ->prototype('scalar')->info('Parameter name')->end()
63                 ->end()
64                 ->arrayNode('connections')
65                     ->prototype('array')
66                         ->children()
67                             ->scalarNode('user')->end()
68                             ->scalarNode('pass')->end()
69                         ->end()
70                     ->end()
71                 ->end()
72                 ->arrayNode('cms_pages')
73                     ->useAttributeAsKey('page')
74                     ->prototype('array')
75                         ->useAttributeAsKey('locale')
76                         ->prototype('array')
77                             ->children()
78                                 ->scalarNode('title')->isRequired()->end()
79                                 ->scalarNode('path')->isRequired()->end()
80                             ->end()
81                         ->end()
82                     ->end()
83                 ->end()
84                 ->arrayNode('pipou')
85                     ->useAttributeAsKey('name')
86                     ->prototype('array')
87                         ->prototype('array')
88                             ->children()
89                                 ->scalarNode('didou')
90                                 ->end()
91                             ->end()
92                         ->end()
93                     ->end()
94                 ->end()
95             ->end()
96         ;
97
98         return $treeBuilder;
99     }
100 }