Issue #3464426 by dcam, kksandr, alexpott: AutowireTrait and autowire for...
Issue #3464426 by dcam, kksandr, alexpott: AutowireTrait and autowire for services behave differently for nullable types
(cherry picked from commit 8cd685b9)
@@ -34,6 +34,10 @@ public static function create(ContainerInterface $container) {
}
if(!$container->has($service)){
if($parameter->allowsNull()){
$args[]=NULL;
continue;
}
thrownewAutowiringFailedException($service,sprintf('Cannot autowire service "%s": argument "$%s" of method "%s::_construct()", you should configure its value explicitly.',$service,$parameter->getName(),static::class));