eee
This commit is contained in:
@@ -73,16 +73,14 @@ class ControllerInterpreter
|
|||||||
*/
|
*/
|
||||||
public function resolveMethod(object $class, string|\ReflectionMethod $reflectionMethod, ReflectionClass $reflectionClass): Handler
|
public function resolveMethod(object $class, string|\ReflectionMethod $reflectionMethod, ReflectionClass $reflectionClass): Handler
|
||||||
{
|
{
|
||||||
|
if (is_string($reflectionMethod)) {
|
||||||
|
$reflectionMethod = $reflectionClass->getMethod($reflectionMethod);
|
||||||
|
}
|
||||||
|
|
||||||
$returnType = $reflectionMethod->getReturnType();
|
$returnType = $reflectionMethod->getReturnType();
|
||||||
if ($returnType instanceof \ReflectionUnionType) {
|
if ($returnType instanceof \ReflectionUnionType) {
|
||||||
throw new Exception("Return type error, cannot be multi type.");
|
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();
|
$container = \Kiri::getDi();
|
||||||
$parameters = $container->getMethodParams($reflectionMethod);
|
$parameters = $container->getMethodParams($reflectionMethod);
|
||||||
|
|||||||
Reference in New Issue
Block a user