改名
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
namespace Annotation\Route;
|
||||
|
||||
|
||||
use Snowflake\Snowflake;
|
||||
|
||||
/**
|
||||
* Class Interceptor
|
||||
* @package Annotation\Route
|
||||
@@ -15,9 +17,16 @@ namespace Annotation\Route;
|
||||
/**
|
||||
* Interceptor constructor.
|
||||
* @param \HttpServer\IInterface\After|\HttpServer\IInterface\After[] $after
|
||||
* @throws
|
||||
*/
|
||||
public function __construct(public string|array $after)
|
||||
{
|
||||
if (is_string($this->after)) {
|
||||
$this->after = [$this->after];
|
||||
}
|
||||
foreach ($this->after as $key => $item) {
|
||||
$this->after[$key] = Snowflake::createObject($item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
namespace Annotation\Route;
|
||||
|
||||
|
||||
use Snowflake\Snowflake;
|
||||
|
||||
/**
|
||||
* Class Interceptor
|
||||
* @package Annotation\Route
|
||||
@@ -15,9 +17,16 @@ namespace Annotation\Route;
|
||||
/**
|
||||
* Interceptor constructor.
|
||||
* @param string|array $interceptor
|
||||
* @throws
|
||||
*/
|
||||
public function __construct(public string|array $interceptor)
|
||||
{
|
||||
if (is_string($this->interceptor)) {
|
||||
$this->interceptor = [$this->interceptor];
|
||||
}
|
||||
foreach ($this->interceptor as $key => $item) {
|
||||
$this->interceptor[$key] = Snowflake::createObject($item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
namespace Annotation\Route;
|
||||
|
||||
|
||||
use Snowflake\Snowflake;
|
||||
|
||||
/**
|
||||
* Class Limits
|
||||
* @package Annotation\Route
|
||||
@@ -15,9 +17,16 @@ namespace Annotation\Route;
|
||||
/**
|
||||
* Limits constructor.
|
||||
* @param string|array $limits
|
||||
* @throws
|
||||
*/
|
||||
public function __construct(public string|array $limits)
|
||||
{
|
||||
if (is_string($this->limits)) {
|
||||
$this->limits = [$this->limits];
|
||||
}
|
||||
foreach ($this->limits as $key => $item) {
|
||||
$this->limits[$key] = Snowflake::createObject($item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
namespace Annotation\Route;
|
||||
|
||||
|
||||
use Snowflake\Snowflake;
|
||||
|
||||
/**
|
||||
* Class Middleware
|
||||
* @package Annotation\Route
|
||||
@@ -15,9 +17,16 @@ namespace Annotation\Route;
|
||||
/**
|
||||
* Interceptor constructor.
|
||||
* @param string|array $middleware
|
||||
* @throws
|
||||
*/
|
||||
public function __construct(public string|array $middleware)
|
||||
{
|
||||
if (is_string($this->middleware)) {
|
||||
$this->middleware = [$this->middleware];
|
||||
}
|
||||
foreach ($this->middleware as $key => $item) {
|
||||
$this->middleware[$key] = Snowflake::createObject($item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user