-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[DI] fix related to preloading #33539
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
Conversation
nicolas-grekas
commented
Sep 10, 2019
Q | A |
---|---|
Branch? | 4.4 |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | - |
License | MIT |
Doc PR | - |
@@ -14,6 +14,10 @@ | |||
use Psr\Cache\CacheItemPoolInterface; | |||
use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage; | |||
|
|||
if (!class_exists(BaseExpressionLanguage::class)) { | |||
throw new \ReflectionException(BaseExpressionLanguage::class.' not found.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
related to #32995
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does that solve #32995 ? It‘s still going to be an exception thrown during autoload. Thus we should get a fatal here, if someone tries to autoload the ExpressionLanguage
class defined in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#32995 is about the fact that PHP 7.4 does not properly allows us to turn a missing parent class into a catcheable exception.
This is throwing an exception before PHP encounters the missing parent class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue described in #32995 happens when the parent class fails to be loaded while the engine already registered the child as "now loading". This throw
happens before the child is flagged as such, thus the exception can be properly caught.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that a return;
would do it too. I'm going to update.
This PR was merged into the 4.4 branch. Discussion ---------- [DI] fix related to preloading | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- e25c595 [DI] fix related to preloading