diff --git a/Container.php b/Container.php index e1a7e90..7f4dffc 100644 --- a/Container.php +++ b/Container.php @@ -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 }; } diff --git a/Scanner.php b/Scanner.php index fd42993..00da921 100644 --- a/Scanner.php +++ b/Scanner.php @@ -96,6 +96,10 @@ class Scanner extends Component if (count($data) > 0) { return; } + $data = $reflect->getAttributes(\Attribute::class); + if (count($data) > 0) { + return; + } $object = $this->container->parse($class); $methods = $this->container->getReflectionClass($class); foreach ($methods->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {