-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Describe the bug
For a contrib Drush command I tried autowiring a container parameter using the Autowire attribute, but it seems like this is not supported.
To Reproduce
After adding this attribute, the command class is no longer being discovered.
Expected behavior
The command class is discovered and the parameter is injected.
Actual behavior
AutowireTrait considers the parameter name a service name. I tried to change AutowireTrait to support this, but so far I haven't found an easy way since League\Container\Container doesn't have getParameter/hasParameter methods.
Workaround
Inject Symfony\Component\DependencyInjection\ContainerInterface and get the parameter from there in the constructor.
System Configuration
| Q | A |
|---|---|
| Drush version? | 13.4.0-rc1 |
| Drupal version? | 11.1.4 |
| PHP version | 8.3.1 |
| OS? | Mac |
Additional information
/
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels