Skip to content
New issue

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

AnnotationWithValueToAttributeRector not applied due to DoctrineAnnotationTagValueNode #297

Open
mfn opened this issue Dec 12, 2023 · 0 comments

Comments

@mfn
Copy link

mfn commented Dec 12, 2023

Hi,

I noticed some @group … directives not being adapted and after a bit debugging I notice that in \Rector\PHPUnit\AnnotationsToAttributes\Rector\Class_\AnnotationWithValueToAttributeRector::refactor the call to getTagsByName returned DoctrineAnnotationTagValueNode instead of GenericTagValueNode.

But there is this check which makes it not pass:

if (!$desiredTagValueNode->value instanceof GenericTagValueNode) {
    continue;
}

As to why: well, I've a (namespaces) class \Project\Models\Group imported in some tests and I guess rector treats the class Group special with @group. However, in my case there's no relation here and since the default config in annotations-to-attributes.php uses the FQCN anyway, there's no clash.

What can I do to still have such @group being converted?

I'm talking about using this in CI, so I'm not looking for a one-time transformation here.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant