-
Notifications
You must be signed in to change notification settings - Fork 96
Closed as not planned
Closed as not planned
Copy link
Description
When using the new Symfony 6.1 AbstractBundle
introduced in symfony/symfony#43701 I'm getting the following error:
final class GraphQLBundle extends AbstractBundle
{
public function configure(DefinitionConfigurator $definition) : void
{
$definition
->rootNode()
->children() // Call to an undefined method Symfony\Component\Config\Definition\Builder\NodeDefinition::children().
->integerNode('debug_flag')
->defaultValue(DebugFlag::NONE)
->isRequired()
->end()
->end();
}
}
I think this is because DefinitionConfigurator::rootNode()
returns NodeDefinition|ArrayNodeDefinition
. It will always return a ArrayNodeDefinition
. Maybe the return type should be changed in Symfony to reflect that?
The TreeBuilderGetRootNodeDynamicReturnTypeExtension won't work anymore because the TreeBuilder instance is created by Symfony for you.
I don't really know what's the best way to solve this in PHPStan. Create a new extension that overwrites the rootNode()
method's return type?
/cc @yceruto
gponty and oliwierptak
Metadata
Metadata
Assignees
Labels
No labels