数据类型

This commit is contained in:
zyimm 2022-08-11 19:19:48 +08:00
parent 0a1a0ed513
commit eda668094a

View File

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