1 | <?php |
||||||
2 | |||||||
3 | declare(strict_types=1); |
||||||
4 | |||||||
5 | namespace Setono\DAOBundle\DependencyInjection; |
||||||
6 | |||||||
7 | use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
||||||
8 | use Symfony\Component\Config\Definition\ConfigurationInterface; |
||||||
9 | |||||||
10 | final class Configuration implements ConfigurationInterface |
||||||
11 | { |
||||||
12 | public function getConfigTreeBuilder(): TreeBuilder |
||||||
13 | { |
||||||
14 | if (method_exists(TreeBuilder::class, 'getRootNode')) { |
||||||
15 | $treeBuilder = new TreeBuilder('setono_dao'); |
||||||
16 | $rootNode = $treeBuilder->getRootNode(); |
||||||
17 | } else { |
||||||
18 | // BC layer for symfony/config 4.1 and older |
||||||
19 | $treeBuilder = new TreeBuilder(); |
||||||
20 | $rootNode = $treeBuilder->root('setono_dao'); |
||||||
0 ignored issues
–
show
|
|||||||
21 | } |
||||||
22 | |||||||
23 | $rootNode |
||||||
24 | ->addDefaultsIfNotSet() |
||||||
0 ignored issues
–
show
The method
addDefaultsIfNotSet() does not exist on Symfony\Component\Config...\Builder\NodeDefinition . It seems like you code against a sub-type of Symfony\Component\Config...\Builder\NodeDefinition such as Symfony\Component\Config...der\ArrayNodeDefinition .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
25 | ->children() |
||||||
26 | ->scalarNode('customer_id') |
||||||
27 | ->isRequired() |
||||||
28 | ->cannotBeEmpty() |
||||||
29 | ->info('Your DAO customer id') |
||||||
30 | ->end() |
||||||
31 | ->scalarNode('password') |
||||||
32 | ->isRequired() |
||||||
33 | ->cannotBeEmpty() |
||||||
34 | ->info('Your DAO password') |
||||||
35 | ->end() |
||||||
36 | ->scalarNode('base_url') |
||||||
37 | ->cannotBeEmpty() |
||||||
38 | ->defaultValue('https://api.dao.as') |
||||||
39 | ->info('The base URL of the DAO API') |
||||||
40 | ->end() |
||||||
41 | ->scalarNode('http_client') |
||||||
42 | ->cannotBeEmpty() |
||||||
43 | ->info('PSR18 HTTP client that is injected into the client service') |
||||||
44 | ->end() |
||||||
45 | ->scalarNode('request_factory') |
||||||
46 | ->cannotBeEmpty() |
||||||
47 | ->info('Is injected into the client service') |
||||||
48 | ->end() |
||||||
49 | ->scalarNode('stream_factory') |
||||||
50 | ->cannotBeEmpty() |
||||||
51 | ->info('Is injected into the client service') |
||||||
52 | ->end() |
||||||
53 | ->end() |
||||||
54 | ; |
||||||
55 | |||||||
56 | return $treeBuilder; |
||||||
57 | } |
||||||
58 | } |
||||||
59 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.