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

fix(7379): Support converting override annotations to attributes #124

Closed

Conversation

annuh
Copy link
Contributor

@annuh annuh commented Aug 18, 2022

Fixes: #7379

Adds support for converting the following annotations to attributes

  • Doctrine\ORM\Mapping\AssociationOverrides
  • Doctrine\ORM\Mapping\AssociationOverride
  • Doctrine\ORM\Mapping\AttributeOverrides
  • Doctrine\ORM\Mapping\AttributeOverride

ToDo: fix converting the properties of the AttributeOverrides annotation.

use Doctrine\ORM\Mapping as ORM;

#[ORM\AssociationOverrides([new ORM\AssociationOverride(name: 'propertyA', inversedBy: 'propertyB')])]
#[ORM\AttributeOverrides([new ORM\AttributeOverride(name: 'id', column: new ORM\Column(type: 'integer'))])]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't work yet:

-#[ORM\AttributeOverrides([new ORM\AttributeOverride(name: 'id', column: new ORM\Column(type: 'integer'))])]
+#[ORM\AttributeOverrides([])]

@TomasVotruba
Copy link
Member

I've done a big refactoring in annotation and nested annotations in the core: rectorphp/rector-src#2781
It should solve this use case too 👍

@TomasVotruba
Copy link
Member

I've cherry picked your commit here #127
With rebased on Rector dev-main. Let's see if it passes :)

@annuh
Copy link
Contributor Author

annuh commented Aug 18, 2022

Nice! Thank you very much 😁

@annuh annuh deleted the fix-7379-support-doctrine-overrides branch October 21, 2022 11:51
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.

None yet

2 participants