This commit is contained in:
2020-09-08 11:55:04 +08:00
parent 215d5517c6
commit cc0a1ec7b5
+32 -36
View File
@@ -39,7 +39,7 @@ class Annotation extends \Snowflake\Annotation\Annotation
private $Middleware = ''; private $Middleware = '';
// private $After = ''; private $After = '';
protected $_annotations = []; protected $_annotations = [];
@@ -87,9 +87,9 @@ class Annotation extends \Snowflake\Annotation\Annotation
case 'Limits': case 'Limits':
$this->bindLimits($node, $annotation); $this->bindLimits($node, $annotation);
break; break;
// case 'After': case 'After':
// $this->bindAfter($node, $annotation); $this->bindAfter($node, $annotation);
// break; break;
} }
} }
@@ -161,38 +161,34 @@ class Annotation extends \Snowflake\Annotation\Annotation
$node->addInterceptor($this->pop($this->getName(...$params))); $node->addInterceptor($this->pop($this->getName(...$params)));
} }
} }
//
//
// /** /**
// * @param Node $node * @param Node $node
// * @param $annotation * @param $annotation
// * @throws * @throws
// */ */
// private function bindAfter($node, $annotation) private function bindAfter($node, $annotation)
// { {
// if (!isset($annotation[1][2])) { if (!isset($annotation[1][2])) {
// return; return;
// } }
//
// $explode = explode(',', $annotation[1][2]); $explode = explode(',', $annotation[1][2]);
//
// [$keyName, $matchs] = $annotation; [$keyName, $matchs] = $annotation;
// foreach ($explode as $middleware) { foreach ($explode as $middleware) {
// $middleware = 'App\Http\Interceptor\\' . $middleware; $middleware = 'App\Http\Interceptor\\' . $middleware;
// if (!class_exists($middleware)) { if (!class_exists($middleware)) {
// continue; continue;
// } }
// $middleware = Snowflake::createObject($middleware); $middleware = Snowflake::createObject($middleware);
// if (!($middleware instanceof Interceptor)) { if (!($middleware instanceof Interceptor)) {
// continue; continue;
// } }
// $node->addAfter([$middleware, 'Interceptor']); $node->addAfter([$middleware, 'Interceptor']);
// continue; }
// }
// $params = [$keyName, [$matchs[0], $matchs[1], $middleware]];
// $node->addInterceptor($this->pop($this->getName(...$params)));
// }
// }
/** /**