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

[Php80] Handle FQCN @\ usage on AnnotationToAttributeRector #5240

Merged
merged 8 commits into from
Nov 23, 2023

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik marked this pull request as draft November 10, 2023 20:37
@samsonasik samsonasik force-pushed the handle-fqcn-annotation-to-attribute branch 2 times, most recently from b288e90 to 6b59d41 Compare November 11, 2023 23:17
@samsonasik samsonasik force-pushed the handle-fqcn-annotation-to-attribute branch from e4c3409 to 84dfbd7 Compare November 21, 2023 23:42
@samsonasik
Copy link
Member Author

Progress 👍 , after rebase of PR:

it now only @Table that not converted:

There was 1 failure:

1) Rector\Core\Tests\Issues\FqcnAnnotationToAttribute\FqcnAnnotationToAttributeTest::test with data set #0
Failed on fixture file "fixture.php.inc"
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
 namespace Rector\Core\Tests\Issues\FqcnAnnotationToAttribute\Fixture;
 
 #[\Doctrine\ORM\Mapping\Entity]
-#[\Doctrine\ORM\Mapping\Table('user')]
 #[\Doctrine\ORM\Mapping\Index(name: 'name_index', columns: ['name'])]
 #[\Doctrine\ORM\Mapping\Index(name: 'surname_index', columns: ['surname'])]
 #[\Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity('azureB2cUuid')]

that seems due to NestedAnnotationToAttribute usage

@samsonasik samsonasik force-pushed the handle-fqcn-annotation-to-attribute branch from 84dfbd7 to f0afc9d Compare November 23, 2023 07:04
@samsonasik samsonasik marked this pull request as ready for review November 23, 2023 09:39
@samsonasik
Copy link
Member Author

@ZZromanZZ Fixed 🎉

@ZZromanZZ
Copy link

Wow, thank you 👍

#[\Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity('azureB2cUuid')]
#[\Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity('uuid')]
#[\Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity('email')]
#[\Doctrine\ORM\Mapping\Table('user')]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this #[\Doctrine\ORM\Mapping\Table('user')] on the last attribute seems due to doctrine configuration structure, I think it doesn't matter :)

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba let's merge it ;)

@samsonasik samsonasik merged commit 51695ae into main Nov 23, 2023
41 checks passed
@samsonasik samsonasik deleted the handle-fqcn-annotation-to-attribute branch November 23, 2023 09:43
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

Successfully merging this pull request may close these issues.

Incorrect behavior of AnnotationToAttributeRector
3 participants