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 broken autoloading due to Reader calling registerFile #323

Merged
merged 1 commit into from
Apr 20, 2020

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Apr 9, 2020

As pointed out by @lcobucci, since the annotation reader invokes AnnotationRegistry::registerFile, we automatically disable the autoload mechanism. This PR fixes this behaviour by exchanging calls to registerFile by class_exists, invoking the standard autoloader we always assume to be present.

@alcaeus alcaeus added the bug label Apr 9, 2020
@alcaeus alcaeus added this to the 1.10.2 milestone Apr 9, 2020
@alcaeus alcaeus requested review from lcobucci and stof April 9, 2020 11:45
@alcaeus alcaeus self-assigned this Apr 9, 2020
@lcobucci
Copy link
Member

lcobucci commented Apr 9, 2020

Looks like a sane approach. Just think that this seems would be a good opportunity to create a functional test for the reader, though.

@stof
Copy link
Member

stof commented Apr 18, 2020

@alcaeus Please either write the functional test (if you plan to do it) or merge it and release it

@alcaeus alcaeus merged commit b9d758e into doctrine:1.10.x Apr 20, 2020
@alcaeus
Copy link
Member Author

alcaeus commented Apr 20, 2020

Will create a test when I have more time on my hands. If anybody wants to contribute this, please do so.

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

Successfully merging this pull request may close these issues.

3 participants