改名
This commit is contained in:
@@ -4,20 +4,17 @@
|
||||
namespace Annotation\Route;
|
||||
|
||||
|
||||
use Annotation\IAnnotation;
|
||||
use Annotation\Attribute;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use ReflectionException;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Snowflake;
|
||||
|
||||
/**
|
||||
* Class Interceptor
|
||||
* @package Annotation\Route
|
||||
*/
|
||||
#[\Attribute(\Attribute::TARGET_METHOD)] class Interceptor implements IAnnotation
|
||||
#[\Attribute(\Attribute::TARGET_METHOD)] class Interceptor extends Attribute
|
||||
{
|
||||
|
||||
use Node;
|
||||
|
||||
/**
|
||||
* Interceptor constructor.
|
||||
@@ -29,6 +26,16 @@ use Snowflake\Snowflake;
|
||||
if (is_string($this->interceptor)) {
|
||||
$this->interceptor = [$this->interceptor];
|
||||
}
|
||||
|
||||
foreach ($this->interceptor as $key => $value) {
|
||||
$sn = Snowflake::createObject($value);
|
||||
|
||||
if (!($sn instanceof \HttpServer\IInterface\Interceptor)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->interceptor[$key] = [$sn, 'Interceptor'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user