From cb1a45a862e0be0f3bd42d46d7b620ee5c271d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 17 Oct 2023 15:59:43 +0800 Subject: [PATCH] eee --- src/ControllerInterpreter.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/ControllerInterpreter.php b/src/ControllerInterpreter.php index 4643df2..0e80e04 100644 --- a/src/ControllerInterpreter.php +++ b/src/ControllerInterpreter.php @@ -73,16 +73,14 @@ class ControllerInterpreter */ public function resolveMethod(object $class, string|\ReflectionMethod $reflectionMethod, ReflectionClass $reflectionClass): Handler { + if (is_string($reflectionMethod)) { + $reflectionMethod = $reflectionClass->getMethod($reflectionMethod); + } + $returnType = $reflectionMethod->getReturnType(); if ($returnType instanceof \ReflectionUnionType) { throw new Exception("Return type error, cannot be multi type."); } - if (empty($reflectionMethod)) { - return new Handler([$class, $reflectionMethod], [], $returnType); - } - if (is_string($reflectionMethod)) { - $reflectionMethod = $reflectionClass->getMethod($reflectionMethod); - } $container = \Kiri::getDi(); $parameters = $container->getMethodParams($reflectionMethod);