This commit is contained in:
2023-12-19 16:26:23 +08:00
parent a51b666303
commit 37c617b26f
4 changed files with 17 additions and 21 deletions
+2 -11
View File
@@ -46,9 +46,7 @@ class ControllerInterpreter
{
$reflection = new \ReflectionFunction($method);
$params = $this->container->resolveMethodParams($reflection);
return new Handler($method, $params, $reflection->getReturnType());
return new Handler($method, $reflection);
}
@@ -81,14 +79,7 @@ class ControllerInterpreter
$reflectionMethod = $reflectionClass->getMethod($reflectionMethod);
}
$returnType = $reflectionMethod->getReturnType();
if ($returnType instanceof \ReflectionUnionType) {
throw new Exception("Return type error, cannot be multi type.");
}
$parameters = $this->container->getMethodParams($reflectionMethod);
return new Handler([$class, $reflectionMethod->getName()], $parameters, $returnType);
return new Handler([$class, $reflectionMethod->getName()], $reflectionMethod);
}
}