From e925a78f02ab3159698c3c819ed0e4e1b56c5fb1 Mon Sep 17 00:00:00 2001 From: whwyy Date: Mon, 18 Dec 2023 16:36:20 +0800 Subject: [PATCH] eee --- Container.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Container.php b/Container.php index 6416190..cc778b5 100644 --- a/Container.php +++ b/Container.php @@ -361,13 +361,15 @@ class Container implements ContainerInterface */ private function getTypeValue(ReflectionParameter $parameter): string|int|bool|null { + $class = $parameter->getDeclaringClass()->getName(); + $name = $parameter->getName(); return match ($parameter->getType()->getName()) { 'string' => '', 'int', 'float' => 0, '', 'mixed' => NULL, - 'array' => [], - 'object' => throw new Exception('Param type must has default value.'), 'bool' => false, + 'object' => throw new Exception('Param type ' . $class . '::' . $name . ' must has default value.'), + 'array' => [], default => null }; }