diff --git a/src/CoreMiddleware.php b/src/CoreMiddleware.php index e2a4538..4cd6beb 100644 --- a/src/CoreMiddleware.php +++ b/src/CoreMiddleware.php @@ -9,14 +9,16 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ -namespace Hyperf\MqttServer; +namespace Zyimm\MqttServer; use Hyperf\Context\Context; use Hyperf\Di\Annotation\AnnotationCollector; use Hyperf\HttpMessage\Base\Response; use Hyperf\HttpServer\Contract\CoreMiddlewareInterface; use Laminas\Stdlib\SplPriorityQueue; +use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; +use Psr\Container\NotFoundExceptionInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; @@ -31,12 +33,12 @@ class CoreMiddleware implements CoreMiddlewareInterface /** * @var ContainerInterface */ - protected $container; + protected ContainerInterface $container; /** * @var string */ - protected $serverName; + protected string $serverName; public function __construct(ContainerInterface $container, string $serverName) { @@ -49,6 +51,15 @@ class CoreMiddleware implements CoreMiddlewareInterface return $request; } + /** + * process + * + * @param ServerRequestInterface $request + * @param RequestHandlerInterface $handler + * @return ResponseInterface + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $type = $request->getAttribute(Types::class);