改名
This commit is contained in:
@@ -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