This commit is contained in:
2020-12-15 17:35:51 +08:00
parent 0b2a575016
commit 070717dbdb
3 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -45,9 +45,9 @@ class Dispatch
* @return mixed
* 执行函数
*/
public function dispatch()
public function dispatch(): mixed
{
return call_user_func($this->handler, $this->request);
return call_user_func($this->handler, ...$this->request);
}
+2 -2
View File
@@ -51,8 +51,8 @@ class Middleware
*/
public function getGenerate(Node $node): mixed
{
return $node->callback = Reduce::reduce(function ($passable) use ($node) {
return Dispatch::create($node->handler, $passable)->dispatch();
return $node->callback = Reduce::reduce(function () use ($node) {
return Dispatch::create($node->handler, func_get_args())->dispatch();
}, $this->annotation($node));
}
+1
View File
@@ -409,6 +409,7 @@ class Node extends Application
if (empty($this->handler)) {
return $this;
}
/** @var Middleware $made */
$made = Snowflake::createObject(Middleware::class);
$made->setMiddleWares($this->middleware);
$made->getGenerate($this);