This commit is contained in:
2020-12-16 15:20:51 +08:00
parent 991c3f9145
commit c2b3f02bfc
7 changed files with 158 additions and 34 deletions
+9
View File
@@ -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);
}
}
}