diff --git a/src/DI/Helpers.php b/src/DI/Helpers.php index 412db989e..194d99bf7 100644 --- a/src/DI/Helpers.php +++ b/src/DI/Helpers.php @@ -116,9 +116,8 @@ public static function autowireArguments(\ReflectionFunctionAbstract $method, ar $optCount = 0; } - } elseif ($parameter->isOptional()) { - // PDO::__construct has optional parameter without default value (and isArray() and allowsNull() returns FALSE) - $res[$num] = $parameter->isDefaultValueAvailable() ? $parameter->getDefaultValue() : NULL; + } elseif ($parameter->isDefaultValueAvailable()) { + $res[$num] = $parameter->getDefaultValue(); $optCount++; } else {