改名
This commit is contained in:
@@ -529,14 +529,14 @@ class Node extends HttpService
|
||||
private function httpFilter(): mixed
|
||||
{
|
||||
try {
|
||||
$dispatchParams = func_num_args();
|
||||
$dispatchParams = func_get_args();
|
||||
if (empty($dispatchParams)) {
|
||||
$dispatchParams = \request();
|
||||
$dispatchParams = [\request()];
|
||||
}
|
||||
if ($this->handler instanceof Closure) {
|
||||
return call_user_func($this->handler, $dispatchParams);
|
||||
return call_user_func($this->handler, ...$dispatchParams);
|
||||
}
|
||||
return $this->runWith($this->callback, $dispatchParams);
|
||||
return $this->runWith($this->callback, ...$dispatchParams);
|
||||
return $this->runFilter(...$dispatchParams);
|
||||
} catch (Throwable $throwable) {
|
||||
$this->addError($throwable, 'throwable');
|
||||
|
||||
@@ -6,7 +6,6 @@ namespace HttpServer\Route;
|
||||
|
||||
use Closure;
|
||||
use HttpServer\IInterface\After;
|
||||
use HttpServer\IInterface\Middleware;
|
||||
use Snowflake\Core\Json;
|
||||
|
||||
class Reduce
|
||||
@@ -53,11 +52,7 @@ class Reduce
|
||||
{
|
||||
return function ($stack, $pipe) {
|
||||
return function ($passable) use ($stack, $pipe) {
|
||||
if ($pipe instanceof Middleware) {
|
||||
return $pipe->onHandler($passable, $stack);
|
||||
} else {
|
||||
return call_user_func($pipe, $passable, $stack);
|
||||
}
|
||||
return call_user_func($pipe, $passable, $stack);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user