File tree Expand file tree Collapse file tree 4 files changed +36
-0
lines changed
stubs/Symfony/Component/Config/Definition/Configurator Expand file tree Collapse file tree 4 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ parameters:
3232 - stubs/Symfony/Bundle/FrameworkBundle/Test/TestContainer.stub
3333 - stubs/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AuthenticatorFactoryInterface.stub
3434 - stubs/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FirewallListenerFactoryInterface.stub
35+ - stubs/Symfony/Component/Config/Definition/Configurator/DefinitionConfigurator.stub
3536 - stubs/Symfony/Component/Console/Command.stub
3637 - stubs/Symfony/Component/Console/Exception/ExceptionInterface.stub
3738 - 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
6767 yield from $ this ->gatherAssertTypes (__DIR__ . '/data/extension/with-configuration-with-constructor/WithConfigurationWithConstructorExtension.php ' );
6868 yield from $ this ->gatherAssertTypes (__DIR__ . '/data/extension/with-configuration-with-constructor-optional-params/WithConfigurationWithConstructorOptionalParamsExtension.php ' );
6969 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 ' );
7076 }
7177
7278 /**
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