改名
This commit is contained in:
@@ -3,19 +3,16 @@ declare(strict_types=1);
|
||||
|
||||
namespace HttpServer\Route;
|
||||
|
||||
use Annotation\Aspect;
|
||||
use Closure;
|
||||
use Database\InjectProperty;
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\HttpService;
|
||||
use HttpServer\Http\Request;
|
||||
use HttpServer\IInterface\Middleware;
|
||||
use HttpServer\IInterface\RouterInterface;
|
||||
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use ReflectionException;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Core\Json;
|
||||
use Snowflake\Exception\ComponentException;
|
||||
use Snowflake\Exception\ConfigException;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Snowflake;
|
||||
@@ -331,9 +328,9 @@ class Router extends HttpService implements RouterInterface
|
||||
* @param string|array $middleware
|
||||
* @return array
|
||||
* @throws NotFindClassException
|
||||
* @throws \ReflectionException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
private function resolve_middleware(string|array $middleware)
|
||||
private function resolve_middleware(string|array $middleware): array
|
||||
{
|
||||
if (is_string($middleware)) {
|
||||
$middleware = [$middleware];
|
||||
@@ -346,9 +343,11 @@ class Router extends HttpService implements RouterInterface
|
||||
if (!($value instanceof Middleware)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$array[] = [$value, 'onHandler'];
|
||||
} else {
|
||||
$array[] = $value;
|
||||
}
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user