This commit is contained in:
xl
2023-11-22 10:30:03 +08:00
parent e0e5455576
commit 576e1c3ad8
2 changed files with 11 additions and 6 deletions
+10 -1
View File
@@ -5,6 +5,8 @@ namespace Kiri\Router;
use Closure;
use Exception;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use ReflectionClass;
use ReflectionException;
use ReflectionMethod;
@@ -18,6 +20,8 @@ class ControllerInterpreter
* @param string|ReflectionMethod $method
* @param ReflectionClass|null $reflection
* @return Handler
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws ReflectionException
*/
public function addRouteByString(object $class, string|ReflectionMethod $method, ?ReflectionClass $reflection = null): Handler
@@ -33,7 +37,8 @@ class ControllerInterpreter
* @param Closure $method
* @return Handler
* @throws ReflectionException
* @throws Exception
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function addRouteByClosure(Closure $method): Handler
{
@@ -50,6 +55,8 @@ class ControllerInterpreter
* @param string|ReflectionMethod $method
* @param ReflectionClass|null $reflection
* @return Handler
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws ReflectionException
*/
public function addRouteByObject(object $class, string|ReflectionMethod $method, ?ReflectionClass $reflection = null): Handler
@@ -67,6 +74,8 @@ class ControllerInterpreter
* @param ReflectionClass $reflectionClass
* @return Handler
* @throws ReflectionException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws Exception
*/
public function resolveMethod(object $class, string|\ReflectionMethod $reflectionMethod, ReflectionClass $reflectionClass): Handler