Closed
Description
Symfony version(s) affected
6.2.6
Description
If I try to autowire a parameter value into a service using the #[Autowire]
attribute, autowiring fails if that parameter is null
. The exception tells me to configure that constructor parameter explicitly. Changing the parameter to a value other than null
makes the exception disappear.
How to reproduce
# services.yaml
parameters:
my_parameter: null
final class MyService
{
public function __construct(
#[Autowire('%my_parameter%')]
private ?string $myParameter,
) {
}
}
Possible Solution
No response
Additional Context
No response