Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
Commit5d6a211
committed
Do not ignore enum when Autowire attribute in RegisterControllerArgumentLocatorsPass
When moving services injected from the constructor to the controller arguments, I noticed a bug.We were auto wiring an env var to a backed enum like this:```phpclass Foo{ public function __construct( #[Autowire(env: 'enum:App\Enum:SOME_ENV_KEY')] private \App\Enum $someEnum, ) {} public function __invoke() {}}```This works fine with normal Symfony Dependency Injection.But when we switch to controller arguments like this:```phpclass Foo{ public function __invoke( #[Autowire(env: 'enum:App\Enum:SOME_ENV_KEY')] \App\Enum $someEnum, ) {}}```This stops working.The issue is that BackedEnum's are excluded. But this should only be excluded when there is no Autowire attribute.1 parentf8f3fc4 commit5d6a211
File tree
2 files changed
+5
-2
lines changed- src/Symfony/Component/HttpKernel
- DependencyInjection
- Tests/DependencyInjection
2 files changed
+5
-2
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
159 | 159 |
| |
160 | 160 |
| |
161 | 161 |
| |
162 |
| - | |
| 162 | + | |
163 | 163 |
| |
164 | 164 |
| |
165 | 165 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
498 | 498 |
| |
499 | 499 |
| |
500 | 500 |
| |
501 |
| - | |
| 501 | + | |
502 | 502 |
| |
503 | 503 |
| |
504 | 504 |
| |
505 | 505 |
| |
506 | 506 |
| |
507 | 507 |
| |
| 508 | + | |
508 | 509 |
| |
509 | 510 |
| |
510 | 511 |
| |
| |||
719 | 720 |
| |
720 | 721 |
| |
721 | 722 |
| |
| 723 | + | |
| 724 | + | |
722 | 725 |
| |
723 | 726 |
| |
724 | 727 |
| |
|
0 commit comments
Comments
(0)