Skip to content

Rector rule on AttributeGroup nodeType not called on 0.18.4 #8237

@etshy

Description

@etshy

Bug Report

Subject Details
Rector version 0.18.4

I made a Rector rule targeting AttributeGroup with rector 0.18.3 and with the latest update, my rule is not called anymore.

    public function getNodeTypes(): array
    {
        return [Node\AttributeGroup::class];
    }

It was a custom rule i made to add/change parameter name after annotations were converted to Attributes.
In my context of migrating Swagger to OpenApi, it was to add parameter name before the new OA\Schema and new OA\Items
For example :

- #[OA\Property(type: 'array', new OA\Items(type: 'integer'))]
+ #[OA\Property(type: 'array', items: new OA\Items(type: 'integer'))]

the rule is called after the AnnotationToAttribute.

The rule worked great on 0.18.3 when i wrote it 2 weeks ago.

Edit : just tested on a project that still have rector 0.18.3, my rule targeting AttributeGroup is called correctly (on class that have attribute, or annotation transformed to attributes by previous rules)

Minimal PHP Code Causing Issue

Demo

Expected Behaviour

Rules targeting AttributeGroup should be called

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions