-
Notifications
You must be signed in to change notification settings - Fork 236
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
AnnotationRegistry fallback to class_exists doesn't seem to work #321
Comments
The AnnotationReader should be changed to trigger the loading of the IgnoreAnnotation class instead of using |
This should have been fixed in #323 |
Thanks for pointing this out @W0rma! @ChrisTitos can you please check with the latest release and let me know if this is fixed? |
Thanks, I can confirm that the registerFileUsed flag is now false as it should be. Though now I'm running into another issue where one of the libraries we use still calls registerAutoloadNamespace to load their library specific annotations, which means the fallback still isn't actually called (since |
@ChrisTitos this is actually expected. The automatic fallback is for projects which don't rely on the old behavior at all. It is intentionally restricted to reduce the BC impact. |
I noticed in our codebase after updating to 1.10.1 and removing the deprecated
registerLoader('class_exists')
call that our custom annotations were not recognized anymore. Getting a "The annotation [...] was never imported. Did you maybe forget to add a "use" statement for this annotation?" error message, though there is in fact a use statement.I thought pull request #271 would fix that, but it appears that class_exists is not called.
I think I narrowed down the cause to the
registerFileUsed
flag. In theAnnotationReader
constructor is a call to registerFile, which means registerFileUsed is always true, which results in the class_exists fallback never being called.The text was updated successfully, but these errors were encountered: