Skip to content

ArrayNodeDefinition no detected for children #464

@shakaran

Description

@shakaran

Doing the DoctrineBundle PR for phpstan level 7 with phpstan-symfony, in the configuration it seems that it is not detected.

I have to use something like:
/** @var NodeBuilder<ArrayNodeDefinition> $children */

But maintainer decide to remove it, which it seems wrong to me since phpstan-symfony should detect automatically.

My workaround:

private function addDbalSection(ArrayNodeDefinition $node): void
    {

        $children = $node->children();
        /** @var NodeBuilder<ArrayNodeDefinition<NodeParentInterface>> $children */
        $children->arrayNode('dbal')

The maintainer solution:

        /** @phpstan-ignore class.notFound (Phpstan Symfony extension does not know yet how to deal with these) */
        $node
            ->children()
            ->arrayNode('dbal')
                ->beforeNormalization()

The specific commit:

doctrine/DoctrineBundle@f021648#diff-ebe00144d6cecb5ca8a2860883e01147f42bbed2b12a3a7f44915908a4829faaL76

I would like that this would be detected and supported

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions