Skip to content

Unable to hook custom rule to some Attribute-related nodes like AttributeGroup #7071

@janedbal

Description

@janedbal

Bug report

NodeScopeResolver is not calling rule callback for some nodes like AttributeGroup or its Args

Code snippet that reproduces the problem

class CustomRule implements Rule
{

    public function getNodeType(): string
    {
        return \PhpParser\Node\AttributeGroup::class;
    }

    public function processNode(Node $node, Scope $scope): array
    {
        return ['Never reported'];
    }

}

Expected output

Error reported.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions