This commit is contained in:
2023-12-18 16:20:38 +08:00
parent 00c089363f
commit 04b64bb4b8
2 changed files with 12 additions and 6 deletions
+8 -6
View File
@@ -357,15 +357,17 @@ class Container implements ContainerInterface
/**
* @param ReflectionParameter $parameter
* @return string|int|bool|null
* @throws
*/
private function getTypeValue(ReflectionParameter $parameter): string|int|bool|null
{
return match ($parameter->getType()) {
'string' => '',
'int', 'float' => 0,
'', null, 'object', 'mixed' => NULL,
'bool' => false,
'default' => null
return match ($parameter->getType()->getName()) {
'string' => '',
'int', 'float' => 0,
'', 'mixed' => NULL,
'array' => [],
'bool' => false,
default => null
};
}