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
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:
```php
class 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:
```php
class 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.
0 commit comments