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