[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 {
|
try {
|
||||||
$value = $this->createAutowiredDefinition($typeHint, $id);
|
$value = $this->createAutowiredDefinition($typeHint, $id);
|
||||||
} catch (RuntimeException $e) {
|
} catch (RuntimeException $e) {
|
||||||
if (!$parameter->isDefaultValueAvailable()) {
|
if ($parameter->allowsNull()) {
|
||||||
|
$value = null;
|
||||||
|
} elseif ($parameter->isDefaultValueAvailable()) {
|
||||||
|
$value = $parameter->getDefaultValue();
|
||||||
|
} else {
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|
||||||
$value = $parameter->getDefaultValue();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (\ReflectionException $reflectionException) {
|
} catch (\ReflectionException $reflectionException) {
|
||||||
|
Reference in New Issue
Block a user