变更
This commit is contained in:
@@ -8,7 +8,12 @@ use Kiri\Di\Context;
|
||||
use Kiri\Router\Constrict\ConstrictResponse;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
use ReflectionException;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Response implements ResponseInterface
|
||||
{
|
||||
|
||||
@@ -19,6 +24,24 @@ class Response implements ResponseInterface
|
||||
public ContentType $contentType = ContentType::JSON;
|
||||
|
||||
|
||||
/**
|
||||
* @var string|SwooleHttpResponseEmitterInterface
|
||||
*/
|
||||
public string|SwooleHttpResponseEmitterInterface $emmit = SwooleHttpResponseEmitterInterface::class;
|
||||
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public function init(): void
|
||||
{
|
||||
if (is_string($this->emmit)) {
|
||||
$this->emmit = di($this->emmit);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param ContentType $contentType
|
||||
* @return Response
|
||||
|
||||
Reference in New Issue
Block a user