modify
This commit is contained in:
@@ -8,9 +8,9 @@ use Annotation\Attribute;
|
||||
use Exception;
|
||||
use HttpServer\HttpFilter;
|
||||
use ReflectionException;
|
||||
use Snowflake\Exception\ComponentException;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Exception\ComponentException;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class Filter
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace Annotation\Route;
|
||||
use Annotation\Attribute;
|
||||
use HttpServer\Route\MiddlewareManager;
|
||||
use ReflectionException;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
use Kiri\Kiri;
|
||||
use HttpServer\IInterface\Middleware as IMiddleware;
|
||||
|
||||
/**
|
||||
@@ -51,7 +51,7 @@ use HttpServer\IInterface\Middleware as IMiddleware;
|
||||
*/
|
||||
public function execute(mixed $class, mixed $method = null): static
|
||||
{
|
||||
$middleware = Snowflake::getDi()->get(MiddlewareManager::class);
|
||||
$middleware = Kiri::getDi()->get(MiddlewareManager::class);
|
||||
$middleware->addMiddlewares($class, $method, $this->middleware);
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Annotation\Route;
|
||||
use Annotation\Attribute;
|
||||
use Exception;
|
||||
use HttpServer\Route\Router;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_METHOD)] class Route extends Attribute
|
||||
{
|
||||
@@ -36,7 +36,7 @@ use Snowflake\Snowflake;
|
||||
public function execute(mixed $class, mixed $method = null): Router
|
||||
{
|
||||
// TODO: Implement setHandler() method.
|
||||
$router = Snowflake::app()->getRouter();
|
||||
$router = Kiri::app()->getRouter();
|
||||
$router->addRoute($this->uri, [$class, $method], $this->method);
|
||||
return $router;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ use HttpServer\Http\Request;
|
||||
use HttpServer\Route\Router;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use Rpc\Actuator;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
|
||||
/**
|
||||
@@ -44,7 +44,7 @@ use Snowflake\Snowflake;
|
||||
public function execute(mixed $class, mixed $method = null): Router
|
||||
{
|
||||
// TODO: Implement setHandler() method.
|
||||
$router = Snowflake::app()->getRouter();
|
||||
$router = Kiri::app()->getRouter();
|
||||
$cmd = $this->cmd;
|
||||
$callback = function (Actuator $actuator) use ($cmd, $class, $method) {
|
||||
$actuator->addListener($cmd, $class::class . '@' . $method);
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Annotation\Route;
|
||||
use Annotation\Attribute;
|
||||
use Exception;
|
||||
use HttpServer\Route\Router;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class Socket
|
||||
@@ -40,7 +40,7 @@ use Snowflake\Snowflake;
|
||||
public function execute(mixed $class, mixed $method = null): Router
|
||||
{
|
||||
// TODO: Implement setHandler() method.
|
||||
$router = Snowflake::app()->getRouter();
|
||||
$router = Kiri::app()->getRouter();
|
||||
|
||||
$path = $this->event . '::' . (is_null($this->uri) ? 'event' : $this->uri);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user