This commit is contained in:
xl
2023-05-26 11:16:44 +08:00
parent c35129be5d
commit e1922193a9
2 changed files with 388 additions and 369 deletions
+10
View File
@@ -29,6 +29,16 @@ class Request implements ServerRequestInterface
public string $exception = ExceptionHandlerDispatcher::class;
/**
* 初始化
*/
public function __construct()
{
$this->middlewares = \config('request.middlewares', []);
$this->exception = \config('request.exception', ExceptionHandlerDispatcher::class);
}
/**
* @return AuthorizationInterface|null
*/
+9
View File
@@ -31,6 +31,15 @@ class Response implements ResponseInterface
public string|ResponseEmitterInterface $emmit = SwooleHttpResponseEmitter::class;
/**
* 初始化
*/
public function __construct()
{
$this->contentType = \config('response.content-type', ContentType::JSON);
$this->emmit = \config('response.emmit', SwooleHttpResponseEmitter::class);
}
/**
* @return void
* @throws ReflectionException