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\SearchBundle\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 | 18 | public function getConfigTreeBuilder() |
|
19 | { |
||
20 | 18 | $treeBuilder = new TreeBuilder('kunstmaan_search'); |
|
21 | 18 | if (method_exists($treeBuilder, 'getRootNode')) { |
|
22 | 18 | $rootNode = $treeBuilder->getRootNode(); |
|
23 | } else { |
||
24 | // BC layer for symfony/config 4.1 and older |
||
25 | $rootNode = $treeBuilder->root('kunstmaan_search'); |
||
0 ignored issues
–
show
|
|||
26 | } |
||
27 | |||
28 | $rootNode |
||
29 | 18 | ->children() |
|
30 | 18 | ->arrayNode('connection') |
|
31 | 18 | ->addDefaultsIfNotSet() |
|
32 | 18 | ->children() |
|
33 | 18 | ->scalarNode('driver') |
|
34 | 18 | ->defaultValue('elastic_search') |
|
35 | 18 | ->validate() |
|
36 | 18 | ->ifNotInArray(['elastic_search']) |
|
37 | 18 | ->thenInvalid('Invalid search driver %s') |
|
38 | 18 | ->end() |
|
39 | 18 | ->end() |
|
40 | 18 | ->scalarNode('host')->defaultNull()->end() //NEXT_MAJOR: Make config required or define default value (localhost) |
|
41 | 18 | ->integerNode('port')->defaultNull()->end() //NEXT_MAJOR: Make config required or define default value (9200) |
|
42 | 18 | ->scalarNode('username')->defaultNull()->end() |
|
43 | 18 | ->scalarNode('password')->defaultNull()->end() |
|
44 | 18 | ->end() |
|
45 | 18 | ->end() |
|
46 | 18 | ->scalarNode('index_prefix')->defaultNull()->end() |
|
47 | 18 | ->arrayNode('analyzer_languages') |
|
48 | 18 | ->useAttributeAsKey('name') |
|
49 | 18 | ->prototype('array') |
|
50 | 18 | ->children() |
|
51 | 18 | ->scalarNode('analyzer')->end() |
|
52 | 18 | ->end() |
|
53 | 18 | ->end() |
|
54 | 18 | ->end() |
|
55 | 18 | ->end(); |
|
56 | |||
57 | 18 | return $treeBuilder; |
|
58 | } |
||
59 | } |
||
60 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.