eee
This commit is contained in:
@@ -5,6 +5,7 @@ namespace Kiri\Router\Annotate;
|
||||
use Kiri\Router\Constrict\RequestMethod;
|
||||
use Kiri\Router\Interface\InjectRouteInterface;
|
||||
use Kiri\Router\Router;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
|
||||
@@ -23,17 +24,19 @@ class Route extends AbstractRequestMethod implements InjectRouteInterface
|
||||
|
||||
|
||||
/**
|
||||
* @param object $class
|
||||
* @param ReflectionClass $class
|
||||
* @param string $method
|
||||
* @return void
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public function dispatch(object $class, string $method): void
|
||||
public function dispatch(ReflectionClass $class, string $method): void
|
||||
{
|
||||
$controller = \Kiri::getDi()->makeReflection($class);
|
||||
// TODO: Implement dispatch() method.
|
||||
$path = '/' . ltrim($this->path, '/');
|
||||
if (!empty($this->version)) {
|
||||
$path = '/' . trim($this->version) . $path;
|
||||
}
|
||||
Router::addRoute([$this->method], $path, [$class, $method]);
|
||||
Router::addRoute([$this->method], $path, [$controller, $method]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user