改名
This commit is contained in:
@@ -129,14 +129,15 @@ class Node extends HttpService
|
|||||||
*/
|
*/
|
||||||
private function createDispatch(): Closure
|
private function createDispatch(): Closure
|
||||||
{
|
{
|
||||||
$application = $this;
|
return $this->normalHandler($this, $this->handler);
|
||||||
|
|
||||||
|
|
||||||
/** @var Aop $aop */
|
/** @var Aop $aop */
|
||||||
$aop = Snowflake::app()->get('aop');
|
$aop = Snowflake::app()->get('aop');
|
||||||
if ($this->handler instanceof Closure || !$aop->hasAop($this->handler)) {
|
if ($this->handler instanceof Closure || !$aop->hasAop($this->handler)) {
|
||||||
return $this->normalHandler($application);
|
return $this->normalHandler($this);
|
||||||
} else {
|
} else {
|
||||||
return $this->aopHandler($aop->getAop($this->handler), $application);
|
return $this->aopHandler($aop->getAop($this->handler), $this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,10 +163,10 @@ class Node extends HttpService
|
|||||||
* @param $application
|
* @param $application
|
||||||
* @return Closure
|
* @return Closure
|
||||||
*/
|
*/
|
||||||
private function normalHandler($application): Closure
|
private function normalHandler($application, $handler): Closure
|
||||||
{
|
{
|
||||||
return static function () use ($application) {
|
return static function () use ($handler) {
|
||||||
return call_user_func($application->handler);
|
return call_user_func($handler);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user