改名
This commit is contained in:
@@ -6,6 +6,8 @@ namespace Annotation\Route;
|
||||
|
||||
use Annotation\Attribute;
|
||||
use HttpServer\Route\MiddlewareManager;
|
||||
use ReflectionException;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Snowflake;
|
||||
use HttpServer\IInterface\Middleware as IMiddleware;
|
||||
|
||||
@@ -30,7 +32,7 @@ use HttpServer\IInterface\Middleware as IMiddleware;
|
||||
|
||||
$array = [];
|
||||
foreach ($this->middleware as $value) {
|
||||
$sn = Snowflake::createObject($value);
|
||||
$sn = di($value);
|
||||
if (!($sn instanceof IMiddleware)) {
|
||||
continue;
|
||||
}
|
||||
@@ -40,11 +42,13 @@ use HttpServer\IInterface\Middleware as IMiddleware;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $class
|
||||
* @param mixed|null $method
|
||||
* @return Middleware
|
||||
*/
|
||||
/**
|
||||
* @param mixed $class
|
||||
* @param mixed|null $method
|
||||
* @return $this
|
||||
* @throws ReflectionException
|
||||
* @throws NotFindClassException
|
||||
*/
|
||||
public function execute(mixed $class, mixed $method = null): static
|
||||
{
|
||||
$middleware = Snowflake::getDi()->get(MiddlewareManager::class);
|
||||
|
||||
Reference in New Issue
Block a user