You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #43579 [DependencyInjection] Fix autowiring tagged arguments from attributes (Okhoshi)
This PR was merged into the 5.3 branch.
Discussion
----------
[DependencyInjection] Fix autowiring tagged arguments from attributes
| Q | A
| ------------- | ---
| Branch? | 5.3
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#43272
| License | MIT
| Doc PR | no
Reimplement #40406 with `AttributeAutoconfigurationPass` to avoid the BC following the change in `CompilerPass` ordering in `PassConfig`.
Also revert the various fix made in an attempt to recover the BC introduced by #40406.
~Note: `5.4` branch was needed because `AttributeAutoconfigurationPass` is not handling parameters in 5.3~
To-do:
- [x] Add a test to cover the breakage presented in #43272
Commits
-------
4c7566f [DependencyInjection] Fix autowiring tagged arguments from attributes
@@ -1044,11 +1044,12 @@ public function testDoNotAutowireDecoratorWhenSeveralArgumentOfTheType()
1044
1044
->setAutowired(true)
1045
1045
;
1046
1046
1047
+
(newDecoratorServicePass())->process($container);
1047
1048
try {
1048
1049
(newAutowirePass())->process($container);
1049
1050
$this->fail('AutowirePass should have thrown an exception');
1050
1051
} catch (AutowiringFailedException$e) {
1051
-
$this->assertSame('Cannot autowire service "Symfony\Component\DependencyInjection\Tests\Compiler\NonAutowirableDecorator": argument "$decorated1" of method "__construct()" references interface "Symfony\Component\DependencyInjection\Tests\Compiler\DecoratorInterface" but no such service exists. You should maybe alias this interface to one of these existing services: "Symfony\Component\DependencyInjection\Tests\Compiler\Decorated", "Symfony\Component\DependencyInjection\Tests\Compiler\NonAutowirableDecorator".', (string) $e->getMessage());
1052
+
$this->assertSame('Cannot autowire service "Symfony\Component\DependencyInjection\Tests\Compiler\NonAutowirableDecorator": argument "$decorated1" of method "__construct()" references interface "Symfony\Component\DependencyInjection\Tests\Compiler\DecoratorInterface" but no such service exists. You should maybe alias this interface to one of these existing services: "Symfony\Component\DependencyInjection\Tests\Compiler\NonAutowirableDecorator", "Symfony\Component\DependencyInjection\Tests\Compiler\NonAutowirableDecorator.inner".', (string) $e->getMessage());
0 commit comments