Skip to content

Make sure doctrine alias rector works in symfony controllers#3146

Merged
TomasVotruba merged 1 commit intorectorphp:masterfrom
acrobat:fix-doctrine-alias-rector
Apr 7, 2020
Merged

Make sure doctrine alias rector works in symfony controllers#3146
TomasVotruba merged 1 commit intorectorphp:masterfrom
acrobat:fix-doctrine-alias-rector

Conversation

@acrobat
Copy link
Copy Markdown
Contributor

@acrobat acrobat commented Apr 7, 2020

While using this rector on a project, I noticed it didn't work on symfony controllers. Because the $this->getDoctrine()->getManager() returns an instance of Doctrine\Persistence\ObjectManager (or the deprecated interface Doctrine\Common\Persistence\ObjectManager). So I've debugged and adjusted the check so it would also work in symfony controllers.

The only strange thing is that the original example (test fixture) does work in the test suite with the old code, but it didn't work in the project I was debugging 🤷‍♂

@TomasVotruba
Copy link
Copy Markdown
Member

Thank you, great job with the test 👍

@TomasVotruba TomasVotruba self-requested a review April 7, 2020 12:29
@TomasVotruba TomasVotruba merged commit 5b0b28c into rectorphp:master Apr 7, 2020
@acrobat acrobat deleted the fix-doctrine-alias-rector branch April 7, 2020 12:47
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.

2 participants