modify
This commit is contained in:
@@ -32,7 +32,7 @@ class Dispatch
|
|||||||
* @throws NotFindClassException
|
* @throws NotFindClassException
|
||||||
* @throws ReflectionException
|
* @throws ReflectionException
|
||||||
*/
|
*/
|
||||||
public static function create($handler, $request): static
|
public static function create($handler,...$request): static
|
||||||
{
|
{
|
||||||
$class = new static();
|
$class = new static();
|
||||||
$class->handler = $handler;
|
$class->handler = $handler;
|
||||||
|
|||||||
@@ -124,8 +124,8 @@ class Node extends HttpService
|
|||||||
*/
|
*/
|
||||||
public function createDispatch(): Closure
|
public function createDispatch(): Closure
|
||||||
{
|
{
|
||||||
return function () {
|
return function (...$params) {
|
||||||
return Dispatch::create($this->handler, ...func_get_args())->dispatch();
|
return Dispatch::create($this->handler, ...$params)->dispatch();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -513,9 +513,8 @@ class Node extends HttpService
|
|||||||
* @return mixed
|
* @return mixed
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function dispatch(): mixed
|
public function dispatch(...$params): mixed
|
||||||
{
|
{
|
||||||
$params = func_get_args();
|
|
||||||
if (empty($this->callback)) {
|
if (empty($this->callback)) {
|
||||||
return Json::to(404, $this->errorMsg());
|
return Json::to(404, $this->errorMsg());
|
||||||
}
|
}
|
||||||
@@ -527,10 +526,9 @@ class Node extends HttpService
|
|||||||
* @return mixed
|
* @return mixed
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function httpFilter(): mixed
|
private function httpFilter(...$param): mixed
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$param = func_get_args();
|
|
||||||
if ($this->handler instanceof Closure) {
|
if ($this->handler instanceof Closure) {
|
||||||
return $this->runWith(...$param);
|
return $this->runWith(...$param);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user