[DI] Autowiring: w/a https://bugs.php.net/62715
This commit is contained in:
parent
8a76fd9dbc
commit
8d49573fb6
@ -91,11 +91,13 @@ class AutowirePass implements CompilerPassInterface
|
||||
try {
|
||||
$value = $this->createAutowiredDefinition($typeHint, $id);
|
||||
} catch (RuntimeException $e) {
|
||||
if (!$parameter->isDefaultValueAvailable()) {
|
||||
if ($parameter->allowsNull()) {
|
||||
$value = null;
|
||||
} elseif ($parameter->isDefaultValueAvailable()) {
|
||||
$value = $parameter->getDefaultValue();
|
||||
} else {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
$value = $parameter->getDefaultValue();
|
||||
}
|
||||
}
|
||||
} catch (\ReflectionException $reflectionException) {
|
||||
|
Reference in New Issue
Block a user