These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Kunstmaan\MultiDomainBundle\DependencyInjection; |
||
4 | |||
5 | use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
||
6 | use Symfony\Component\Config\Definition\ConfigurationInterface; |
||
7 | |||
8 | /** |
||
9 | * This is the class that validates and merges configuration from your app/config files |
||
10 | * |
||
11 | * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} |
||
12 | */ |
||
13 | class Configuration implements ConfigurationInterface |
||
14 | { |
||
15 | /** |
||
16 | * {@inheritdoc} |
||
17 | */ |
||
18 | public function getConfigTreeBuilder() |
||
19 | { |
||
20 | $treeBuilder = new TreeBuilder(); |
||
21 | $rootNode = $treeBuilder->root('kunstmaan_multi_domain'); |
||
22 | |||
23 | $rootNode |
||
24 | ->children() |
||
25 | ->arrayNode('hosts') |
||
26 | ->isRequired() |
||
27 | ->requiresAtLeastOneElement() |
||
28 | // ->useAttributeAsKey('host') |
||
0 ignored issues
–
show
|
|||
29 | ->prototype('array') |
||
30 | ->children() |
||
31 | ->scalarNode('host') |
||
32 | ->isRequired() |
||
33 | ->end() |
||
34 | ->scalarNode('protocol') |
||
35 | ->defaultValue('http') |
||
36 | ->end() |
||
37 | ->arrayNode('aliases') |
||
38 | ->prototype('scalar')->end() |
||
39 | ->end() |
||
40 | ->scalarNode('type') |
||
41 | ->defaultValue('single_lang') |
||
42 | ->end() |
||
43 | ->scalarNode('root') |
||
44 | ->defaultValue('homepage') |
||
45 | ->end() |
||
46 | ->variableNode('extra') |
||
47 | ->end() |
||
48 | ->scalarNode('default_locale') |
||
49 | ->isRequired() |
||
50 | ->end() |
||
51 | ->arrayNode('locales') |
||
52 | ->isRequired() |
||
53 | ->requiresAtLeastOneElement() |
||
54 | ->prototype('array') |
||
55 | ->children() |
||
56 | ->scalarNode('uri_locale')->isRequired()->end() |
||
57 | ->scalarNode('locale')->isRequired()->end() |
||
58 | ->variableNode('extra')->end() |
||
59 | ->end() |
||
60 | ->end() |
||
61 | ->end() |
||
62 | ->end() |
||
63 | ->end() |
||
64 | ->end(); |
||
65 | |||
66 | return $treeBuilder; |
||
67 | } |
||
68 | } |
||
69 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.