-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
The autoloader throws an exception on class_exists. #14085
Conversation
|
We cannot process PR with broken tests. Prior to a full code review please make sure all Travis CI builds are green. |
This PR is not meant to fix anything. It is meant to show that the code has a bug. Someone with greater knowledge of Magento internals should use this PR/commit/test and add a fix to the problem. |
One do not have to remove code just because they it has a bug in it. One could simply try to improve in instead. Thank you for taking the time to read and answer my posts. |
@Nyholm, from another thread
One suggestion was
having a huge Magento expertise I simply don't see what can be changed to keep both scenarios workable. I don't ask you for a code, if you ever come up with a conceptual idea just share it. For the reference, here is the current implementation: https://github.com/magento/magento2/blob/2.2-develop/lib/internal/Magento/Framework/Code/Generator.php#L91 |
An autoloader that throws an exception is not PSR-4 compliant:
|
Hi @Nyholm, thank you for your contribution! |
Description
The autoloader throws an exception on
class_exists
. That is clearly an unexpected behavior according to the documentation: http://php.net/manual/en/function.class-exists.phpThis will cause issues when including third party libraries that is not written for Magento.
Fixed Issues (if relevant)
Manual testing scenarios
Run
class_exists('FooFactory')
. It should returnfalse
but an error is thrown instead.Contribution checklist
FYI @NickvdMeij