modify plugin name
This commit is contained in:
@@ -9,11 +9,11 @@ use Kiri\Annotation\AbstractAttribute;
|
||||
|
||||
|
||||
/**
|
||||
* @param Method $method
|
||||
* @param RequestMethod $method
|
||||
* @param string $path
|
||||
* @param string|null $version
|
||||
*/
|
||||
public function __construct(Method $method, string $path, string $version = null)
|
||||
public function __construct(RequestMethod $method, string $path, string $version = null)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Kiri\Annotation\Route;
|
||||
|
||||
enum Method
|
||||
enum RequestMethod
|
||||
{
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ use Kiri;
|
||||
/**
|
||||
* Route constructor.
|
||||
* @param string $uri
|
||||
* @param Method $method
|
||||
* @param RequestMethod $method
|
||||
* @param string $version
|
||||
*/
|
||||
public function __construct(public string $uri, public Method $method, public string $version = 'v.1.0')
|
||||
public function __construct(public string $uri, public RequestMethod $method, public string $version = 'v.1.0')
|
||||
{
|
||||
$this->uri = '/' . ltrim($this->uri, '/');
|
||||
}
|
||||
@@ -31,7 +31,7 @@ use Kiri;
|
||||
public function execute(mixed $class, mixed $method = null): bool
|
||||
{
|
||||
$di = Kiri::getDi()->get(Router::class);
|
||||
$di->addRoute($this->method->getString(), $this->uri, $class . '@' . $method);
|
||||
$di->addRoute($this->method, $this->uri, $class . '@' . $method);
|
||||
return parent::execute($class, $method);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class TestController
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
#[RequestMapping(method: Method::REQUEST_GET, path: '/', version: 'v1')]
|
||||
#[RequestMapping(method: RequestMethod::REQUEST_GET, path: '/', version: 'v1')]
|
||||
#[Aspect(aspect: LoggerAspect::class)]
|
||||
#[Middleware(middleware: LoggerAspect::class)]
|
||||
public function index()
|
||||
|
||||
Reference in New Issue
Block a user