Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DependencyInjection] Resolve ChildDefinition in AbstractRecursivePass#44418
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[DependencyInjection] Resolve ChildDefinition in AbstractRecursivePass#44418
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| if ($factory) { | ||
| [$class,$method] =$factory; | ||
| if ('__construct' ===$method) { |
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.
Let's throw as soon as possible?
| try { | ||
| if (!$r =$this->container->getReflectionClass($class)) { | ||
| if (null ===$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.
This is a minor DX improvement. If the class is null this message looks better to me thanInvalid service "foo": class "" does not exist. (seegetReflectionMethod() below where we already check if a class is set or not).
src/Symfony/Component/DependencyInjection/Tests/Compiler/AbstractRecursivePassTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
86febb1 toacbee81Comparenicolas-grekas commentedDec 11, 2021
Thank you@fancyweb. |
At least
AttributeAutoconfigurationPass(5.4 new pass) relies onAbstractRecursivePassand is executed beforeResolveChildDefinitionsPassso child definitions are not necessary resolved inAbstractRecursivePass. Doing it on 4.4 to have the same behavior on all maintained branches.Itfixes#44342 in a better way because the final class of the factory can be resolved.