modify
This commit is contained in:
@@ -38,7 +38,7 @@ use Snowflake\Snowflake;
|
||||
* @param array $handler
|
||||
* @return After
|
||||
*/
|
||||
public function execute(array $handler): static
|
||||
public function execute(mixed $class, mixed $method = null): static
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ use Annotation\Attribute;
|
||||
* @param array $handler
|
||||
* @return array
|
||||
*/
|
||||
public function execute(array $handler): array
|
||||
public function execute(mixed $class, mixed $method = null): array
|
||||
{
|
||||
// TODO: Implement execute() method.
|
||||
return [$this->request, $this->response];
|
||||
|
||||
@@ -33,7 +33,7 @@ use Snowflake\Snowflake;
|
||||
* @return bool
|
||||
* @throws Exception
|
||||
*/
|
||||
public function execute(array $handler): bool
|
||||
public function execute(mixed $class, mixed $method = null): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ use Snowflake\Snowflake;
|
||||
* @param array $handler
|
||||
* @return Interceptor
|
||||
*/
|
||||
public function execute(array $handler): static
|
||||
public function execute(mixed $class, mixed $method = null): static
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ use Snowflake\Snowflake;
|
||||
* @param array $handler
|
||||
* @return Limits
|
||||
*/
|
||||
public function execute(array $handler): static
|
||||
public function execute(mixed $class, mixed $method = null): static
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ use HttpServer\IInterface\Middleware as IMiddleware;
|
||||
* @param array $handler
|
||||
* @return Middleware
|
||||
*/
|
||||
public function execute(array $handler): static
|
||||
public function execute(mixed $class, mixed $method = null): static
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -34,12 +34,12 @@ use Snowflake\Snowflake;
|
||||
* @throws ConfigException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function execute(array $handler): Router
|
||||
public function execute(mixed $class, mixed $method = null): Router
|
||||
{
|
||||
// TODO: Implement setHandler() method.
|
||||
$router = Snowflake::app()->getRouter();
|
||||
|
||||
$router->addRoute($this->uri, $handler, $this->method);
|
||||
$router->addRoute($this->uri, [$class, $method], $this->method);
|
||||
|
||||
return $router;
|
||||
}
|
||||
|
||||
@@ -42,12 +42,12 @@ use Snowflake\Snowflake;
|
||||
* @return Router
|
||||
* @throws Exception
|
||||
*/
|
||||
public function execute(array $handler): Router
|
||||
public function execute(mixed $class, mixed $method = null): Router
|
||||
{
|
||||
// TODO: Implement setHandler() method.
|
||||
$router = Snowflake::app()->getRouter();
|
||||
|
||||
$router->addRoute($this->uri, $handler, Request::HTTP_CMD)
|
||||
$router->addRoute($this->uri, [$class, $method], Request::HTTP_CMD)
|
||||
->setDataType($this->protocol);
|
||||
|
||||
return $router;
|
||||
|
||||
@@ -44,14 +44,14 @@ use Snowflake\Snowflake;
|
||||
* @return Router
|
||||
* @throws Exception
|
||||
*/
|
||||
public function execute(array $handler): Router
|
||||
public function execute(mixed $class, mixed $method = null): Router
|
||||
{
|
||||
// TODO: Implement setHandler() method.
|
||||
$router = Snowflake::app()->getRouter();
|
||||
|
||||
$method = $this->event . '::' . (is_null($this->uri) ? 'event' : $this->uri);
|
||||
|
||||
$router->addRoute($method, $handler, 'sw::socket');
|
||||
$router->addRoute($method, [$class, $method], 'sw::socket');
|
||||
|
||||
return $router;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user