This commit is contained in:
xl
2023-11-22 17:16:10 +08:00
parent 76e0e5a88b
commit 0cf51a26e8
2 changed files with 15 additions and 19 deletions
+12 -2
View File
@@ -31,12 +31,22 @@ class Response implements ResponseInterface
/**
* 初始化
* @throws
*/
public function __construct()
{
$this->contentType = \config('response.content-type', ContentType::JSON);
$this->emmit = di(\config('response.emmit', SwooleHttpResponseEmitter::class));
$this->emmit = \config('response.emmit', SwooleHttpResponseEmitter::class);
}
/**
* @return void
* @throws ReflectionException
*/
public function init(): void
{
if (is_string($this->emmit)) {
$this->emmit = di($this->emmit);
}
}