This commit is contained in:
2021-04-22 14:22:11 +08:00
parent 6a085db0b4
commit 397bc3c80f
3 changed files with 30 additions and 27 deletions
-1
View File
@@ -45,7 +45,6 @@ class Handler extends HttpService
* @param $route * @param $route
* @param $handler * @param $handler
* @return Handler|Node|null * @return Handler|Node|null
* @throws ConfigException
*/ */
public function handler($route, $handler): Handler|Node|null public function handler($route, $handler): Handler|Node|null
{ {
+2 -1
View File
@@ -546,7 +546,8 @@ class Node extends HttpService
/** /**
* @return Validator|bool * @param $dispatchParams
* @return mixed
* @throws Exception * @throws Exception
*/ */
private function runValidator($dispatchParams): mixed private function runValidator($dispatchParams): mixed
+9 -6
View File
@@ -42,6 +42,8 @@ class Aop extends Component
/** /**
* @param $handler
* @param $params
* @return mixed * @return mixed
* @throws NotFindClassException * @throws NotFindClassException
* @throws ReflectionException * @throws ReflectionException
@@ -65,10 +67,11 @@ class Aop extends Component
* @param $params * @param $params
* @param $aopName * @param $aopName
* @return mixed * @return mixed
* @throws \ReflectionException * @throws ReflectionException
* @throws \Snowflake\Exception\NotFindClassException * @throws NotFindClassException
* @throws Exception
*/ */
private function invoke($handler, $params, $aopName) private function invoke($handler, $params, $aopName): mixed
{ {
$reflect = Snowflake::getDi()->getReflect(current($this->_aop[$aopName])); $reflect = Snowflake::getDi()->getReflect(current($this->_aop[$aopName]));
if (!$reflect->isInstantiable() || !$reflect->hasMethod('invoke')) { if (!$reflect->isInstantiable() || !$reflect->hasMethod('invoke')) {
@@ -83,10 +86,10 @@ class Aop extends Component
/** /**
* @param $handler * @param $handler
* @param $params * @param $params
* @return false|mixed * @return mixed
* @throws \Exception * @throws Exception
*/ */
private function notFound($handler, $params) private function notFound($handler, $params): mixed
{ {
if (!method_exists($handler[0], $handler[1])) { if (!method_exists($handler[0], $handler[1])) {
return response()->close(404); return response()->close(404);