modify
This commit is contained in:
@@ -118,8 +118,8 @@ class Node extends HttpService
|
|||||||
if ($this->handler instanceof Closure || !$aop->hasAop($this->handler)) {
|
if ($this->handler instanceof Closure || !$aop->hasAop($this->handler)) {
|
||||||
return static function () use ($application) {
|
return static function () use ($application) {
|
||||||
$dispatchParam = Context::getContext('dispatch-param', [\request()]);
|
$dispatchParam = Context::getContext('dispatch-param', [\request()]);
|
||||||
if (is_array($this->handler)){
|
if (is_array($application->handler)){
|
||||||
Snowflake::injectProperty($this->handler[0]);
|
Snowflake::injectProperty($application->handler[0]);
|
||||||
}
|
}
|
||||||
return call_user_func($application->handler, ...$dispatchParam);
|
return call_user_func($application->handler, ...$dispatchParam);
|
||||||
};
|
};
|
||||||
@@ -127,13 +127,12 @@ class Node extends HttpService
|
|||||||
|
|
||||||
$reflect = $aop->getAop($this->handler);
|
$reflect = $aop->getAop($this->handler);
|
||||||
$callback = [$reflect->getMethod('invoke'), 'invokeArgs'];
|
$callback = [$reflect->getMethod('invoke'), 'invokeArgs'];
|
||||||
|
|
||||||
return static function () use ($callback, $application, $reflect) {
|
return static function () use ($callback, $application, $reflect) {
|
||||||
$dispatchParam = Context::getContext('dispatch-param', [\request()]);
|
$dispatchParam = Context::getContext('dispatch-param', [\request()]);
|
||||||
|
|
||||||
$asp = $reflect->newInstance($this->handler);
|
$asp = $reflect->newInstance($application->handler);
|
||||||
if (is_array($this->handler)){
|
if (is_array($application->handler)){
|
||||||
Snowflake::injectProperty($this->handler[0]);
|
Snowflake::injectProperty($application->handler[0]);
|
||||||
}
|
}
|
||||||
call_user_func($callback, $asp, $dispatchParam);
|
call_user_func($callback, $asp, $dispatchParam);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user