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

flip attribute driver constructor arguments #2359

Merged
merged 1 commit into from
Aug 12, 2021

Conversation

IonBazan
Copy link
Member

Q A
Type bug
BC Break no

Summary

Because AbstractDoctrineExtension expects the AttributeDriver constructor to accept $paths as first argument, while AnnotationDriver expects Reader to be passed there, we need to shift the argument order to make it compatible.
https://github.com/symfony/symfony/blob/1d196159fde010590b857059b5219922031c284b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php#L209-L212

While ORM's AttributeDriver simply skips that argument and does not allow to customize the reader, I decided to simply shift the argument order to maintain the compatibility with AbstractDoctrineExtension and allow to customize the reader.

Copy link
Contributor

@franmomu franmomu left a comment

Choose a reason for hiding this comment

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

@IonBazan
Copy link
Member Author

@franmomu You are right, I think I reverted that change at some point as I thought it is not necessary but when I was trying to use it in a Symfony app, it turned out that we have to keep the constructor this way, at least for now 🤷🏻‍♂️

@alcaeus alcaeus added this to the 2.3.0 milestone Aug 12, 2021
@alcaeus alcaeus self-assigned this Aug 12, 2021
@alcaeus alcaeus merged commit bc77760 into doctrine:2.3.x Aug 12, 2021
@alcaeus
Copy link
Member

alcaeus commented Aug 12, 2021

Thanks @IonBazan!

@IonBazan IonBazan deleted the attribute-driver branch August 12, 2021 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants