Please sign in to comment.
bug #22857 [DI] Fix autowire error for inlined services (weaverryan)
This PR was squashed before being merged into the 3.3 branch (closes #22857). Discussion ---------- [DI] Fix autowire error for inlined services | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #22848 | License | MIT | Doc PR | n/a The `AutowirePass` defers autowiring exceptions until later so that we don't throw autowiring exceptions for services that are ultimately removed. But, if a service is *inlined*, then it appears to be removed, and so we don't throw the exception. This fixes that. It's an easy fix - but it's a bit ugly. We're adding a bit more "state" to the passes... simply because there is some information that needs to be shared through the compiler process. There might be a better way of doing this in the future (e.g. storing some metadata on the `Compiler`), but this *does* work well. Commits ------- 4bcef3d [DI] Fix autowire error for inlined services
- Loading branch information...
Showing with 99 additions and 7 deletions.
- +17 −3 src/Symfony/Component/DependencyInjection/Compiler/AutowireExceptionPass.php
- +12 −0 src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php
- +2 −2 src/Symfony/Component/DependencyInjection/Compiler/PassConfig.php
- +44 −2 src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowireExceptionPassTest.php
- +24 −0 src/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php