We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi @seferov
The following code
public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder('sonata_doctrine_orm_admin'); $rootNode = $treeBuilder->getRootNode(); \assert($rootNode instanceof ArrayNodeDefinition); $rootNode ->children() ->scalarNode('entity_manager')->defaultNull()->end() ->arrayNode('audit') // The error is here ->addDefaultsIfNotSet() ->children() ->booleanNode('force')->defaultTrue()->end() ->end() ->end() ->end(); return $treeBuilder; }
Is returning a psalm error because arrayNode is called on possibly null value.
arrayNode
Indeed end() might return null, but not here, because of the ->children() call. Do you think there is a way to avoid this false positive ?
end()
->children()
The text was updated successfully, but these errors were encountered:
@VincentLanglet hi,
I think it is hard avoid it by just creating stubs. Correct parent node should be set for each child node builder as a parent. I have no idea for now.
Sorry, something went wrong.
@VincentLanglet can you check if it is working as expected with v2.3.0? it might be fixed with #170
Nope, the issue is still here.
No branches or pull requests
Hi @seferov
The following code
Is returning a psalm error because
arrayNode
is called on possibly null value.Indeed
end()
might return null, but not here, because of the->children()
call.Do you think there is a way to avoid this false positive ?
The text was updated successfully, but these errors were encountered: