1 | <?php |
||||||
2 | |||||||
3 | declare(strict_types=1); |
||||||
4 | |||||||
5 | namespace Setono\SyliusReserveStockPlugin\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 | private const DEFAULT_TTL = 3600; |
||||||
13 | |||||||
14 | /** |
||||||
15 | * {@inheritdoc} |
||||||
16 | */ |
||||||
17 | public function getConfigTreeBuilder(): TreeBuilder |
||||||
18 | { |
||||||
19 | if (method_exists(TreeBuilder::class, 'getRootNode')) { |
||||||
20 | $treeBuilder = new TreeBuilder('setono_sylius_reserve_stock'); |
||||||
21 | $rootNode = $treeBuilder->getRootNode(); |
||||||
22 | } else { |
||||||
23 | $treeBuilder = new TreeBuilder(); |
||||||
24 | $rootNode = $treeBuilder->root('setono_sylius_reserve_stock'); |
||||||
0 ignored issues
–
show
|
|||||||
25 | } |
||||||
26 | $rootNode |
||||||
27 | ->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
![]() |
|||||||
28 | ->children() |
||||||
29 | ->integerNode('ttl') |
||||||
30 | ->defaultValue(self::DEFAULT_TTL) |
||||||
31 | ->example(1800) |
||||||
32 | ->info('Define the Time To Live (TTL) in seconds for a product reservation. Setting to 0 disables this check, all carts will be taken in account for an indefinite period.') |
||||||
33 | ->end() |
||||||
34 | ->end() |
||||||
35 | ; |
||||||
36 | |||||||
37 | return $treeBuilder; |
||||||
38 | } |
||||||
39 | } |
||||||
40 |
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.