incompass /
injection-bundle
| 1 | <?php declare(strict_types=1); |
||
| 2 | |||
| 3 | namespace Incompass\InjectionBundle\DependencyInjection; |
||
| 4 | |||
| 5 | use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
||
| 6 | use Symfony\Component\Config\Definition\ConfigurationInterface; |
||
| 7 | |||
| 8 | /** |
||
| 9 | * Class Configuration |
||
| 10 | * |
||
| 11 | * @author Joe Mizzi <[email protected]> |
||
| 12 | * |
||
| 13 | * @codeCoverageIgnore |
||
| 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(): TreeBuilder |
||
| 23 | { |
||
| 24 | $treeBuilder = new TreeBuilder(); |
||
| 25 | $rootNode = $treeBuilder->root('injection'); |
||
| 26 | $rootNode |
||
| 27 | ->addDefaultsIfNotSet() |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 28 | ->children() |
||
| 29 | ->arrayNode('paths') |
||
| 30 | ->defaultValue(['src' => 'App\\']) |
||
| 31 | ->prototype('scalar') |
||
| 32 | ->end() |
||
| 33 | ->end() |
||
| 34 | ->arrayNode('environment_groups') |
||
| 35 | ->useAttributeAsKey('group') |
||
| 36 | ->defaultValue([]) |
||
| 37 | ->arrayPrototype() |
||
| 38 | ->children() |
||
| 39 | ->arrayNode('environments') |
||
| 40 | ->scalarPrototype() |
||
| 41 | ->end() |
||
| 42 | ->end() |
||
| 43 | ->end() |
||
| 44 | ->end() |
||
| 45 | ->end(); |
||
| 46 | return $treeBuilder; |
||
| 47 | } |
||
| 48 | } |