diff --git a/Annotation/Annotation.php b/Annotation/Annotation.php index c9c23040..63ec495f 100644 --- a/Annotation/Annotation.php +++ b/Annotation/Annotation.php @@ -30,7 +30,7 @@ class Annotation extends Component * @return array 根据类名获取注解 * 根据类名获取注解 */ - public function getMethods(string $className, string $method = ''): array + public function getMethods(string $className, string $method = ''): mixed { return $this->_loader->getMethod($className, $method); } diff --git a/Annotation/Loader.php b/Annotation/Loader.php index d0a49b4b..a6e16069 100644 --- a/Annotation/Loader.php +++ b/Annotation/Loader.php @@ -96,7 +96,7 @@ class Loader extends BaseObject public function getMethod(string $class, string $method = ''): mixed { if (!isset($this->_classes[$class])) { - return []; + return null; } $properties = $this->_classes[$class]['methods']; if (!empty($property) && isset($properties[$method])) {