改名
This commit is contained in:
@@ -126,12 +126,14 @@ class Node extends HttpService
|
|||||||
*/
|
*/
|
||||||
public function createDispatch(): Closure
|
public function createDispatch(): Closure
|
||||||
{
|
{
|
||||||
return static function () {
|
$application = $this;
|
||||||
|
return static function () use ($application) {
|
||||||
$dispatchParam = Context::getContext('dispatch-param', [\request()]);
|
$dispatchParam = Context::getContext('dispatch-param', [\request()]);
|
||||||
if (empty($this->_aop) || $this->handler instanceof Closure) {
|
if (empty($application->_aop) || $application->handler instanceof Closure) {
|
||||||
return call_user_func($this->handler, ...$dispatchParam);
|
return call_user_func($application->handler, ...$dispatchParam);
|
||||||
}
|
}
|
||||||
return call_user_func($this->_aop[0], $this->_aop[1], $dispatchParam);
|
$application->_aop[] = $dispatchParam;
|
||||||
|
return call_user_func(...$application->_aop);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,10 +150,10 @@ class Node extends HttpService
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$reflect = $aop->getAop($this->handler);
|
$reflect = $aop->getAop($this->handler);
|
||||||
|
$this->_aop = [
|
||||||
$method = $reflect->getMethod('invoke');
|
[$reflect->getMethod('invoke'), 'invokeArgs'],
|
||||||
|
$reflect->newInstance($this->handler)
|
||||||
$this->_aop = [[$method, 'invokeArgs'], $reflect->newInstance($this->handler)];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user