File tree 4 files changed +36
-0
lines changed
stubs/Symfony/Component/Config/Definition/Configurator
4 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ parameters:
32
32
- stubs/Symfony/Bundle/FrameworkBundle/Test/TestContainer.stub
33
33
- stubs/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AuthenticatorFactoryInterface.stub
34
34
- stubs/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FirewallListenerFactoryInterface.stub
35
+ - stubs/Symfony/Component/Config/Definition/Configurator/DefinitionConfigurator.stub
35
36
- stubs/Symfony/Component/Console/Command.stub
36
37
- stubs/Symfony/Component/Console/Exception/ExceptionInterface.stub
37
38
- stubs/Symfony/Component/Console/Exception/InvalidArgumentException.stub
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Symfony\Component\Config\Definition\Configurator;
4
+
5
+ use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
6
+
7
+ class DefinitionConfigurator
8
+ {
9
+ public function rootNode(): ArrayNodeDefinition;
10
+ }
Original file line number Diff line number Diff line change @@ -67,6 +67,12 @@ public function dataFileAsserts(): iterable
67
67
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/extension/with-configuration-with-constructor/WithConfigurationWithConstructorExtension.php ' );
68
68
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/extension/with-configuration-with-constructor-optional-params/WithConfigurationWithConstructorOptionalParamsExtension.php ' );
69
69
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/extension/with-configuration-with-constructor-required-params/WithConfigurationWithConstructorRequiredParamsExtension.php ' );
70
+
71
+ if (!class_exists ('Symfony\Component\Config\Definition\Configurator\DefinitionConfigurator ' )) {
72
+ return ;
73
+ }
74
+
75
+ yield from $ this ->gatherAssertTypes (__DIR__ . '/data/definition_configurator.php ' );
70
76
}
71
77
72
78
/**
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types = 1 );
2
+
3
+ use Symfony \Component \Config \Definition \Builder \TreeBuilder ;
4
+ use Symfony \Component \Config \Definition \Configurator \DefinitionConfigurator ;
5
+ use Symfony \Component \Config \Definition \Loader \DefinitionFileLoader ;
6
+ use function PHPStan \Testing \assertType ;
7
+
8
+ $ treeBuilder = new TreeBuilder ('my_tree ' );
9
+ $ loader = new DefinitionFileLoader ($ treeBuilder , new \Symfony \Component \Config \FileLocator ());
10
+
11
+ $ configurator = new DefinitionConfigurator (
12
+ $ treeBuilder ,
13
+ $ loader ,
14
+ '' ,
15
+ ''
16
+ );
17
+
18
+ $ rootNode = $ configurator ->rootNode ();
19
+ assertType ('Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition ' , $ rootNode );
You can’t perform that action at this time.
0 commit comments