改名
This commit is contained in:
@@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -545,10 +545,11 @@ class Node extends HttpService
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Validator|bool
|
* @param $dispatchParams
|
||||||
* @throws Exception
|
* @return mixed
|
||||||
*/
|
* @throws Exception
|
||||||
|
*/
|
||||||
private function runValidator($dispatchParams): mixed
|
private function runValidator($dispatchParams): mixed
|
||||||
{
|
{
|
||||||
/** @var HttpFilter $filter */
|
/** @var HttpFilter $filter */
|
||||||
|
|||||||
+25
-22
@@ -41,12 +41,14 @@ class Aop extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @param $handler
|
||||||
* @throws NotFindClassException
|
* @param $params
|
||||||
* @throws ReflectionException
|
* @return mixed
|
||||||
* @throws Exception
|
* @throws NotFindClassException
|
||||||
*/
|
* @throws ReflectionException
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
final public function dispatch($handler, $params): mixed
|
final public function dispatch($handler, $params): mixed
|
||||||
{
|
{
|
||||||
if ($handler instanceof \Closure) {
|
if ($handler instanceof \Closure) {
|
||||||
@@ -60,15 +62,16 @@ class Aop extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $handler
|
* @param $handler
|
||||||
* @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')) {
|
||||||
@@ -80,13 +83,13 @@ 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);
|
||||||
|
|||||||
Reference in New Issue
Block a user