This commit is contained in:
2021-08-04 10:15:18 +08:00
parent fa09277f1f
commit d688ca175b
+6 -6
View File
@@ -14,10 +14,7 @@ use HttpServer\Abstracts\HttpService;
use HttpServer\Http\Formatter\HtmlFormatter; use HttpServer\Http\Formatter\HtmlFormatter;
use HttpServer\Http\Formatter\JsonFormatter; use HttpServer\Http\Formatter\JsonFormatter;
use HttpServer\Http\Formatter\XmlFormatter; use HttpServer\Http\Formatter\XmlFormatter;
use HttpServer\IInterface\IFormatter; use Snowflake\Exception\NotFindClassException;
use Snowflake\Core\Help;
use Snowflake\Snowflake;
use Swoole\Coroutine;
use Swoole\Http\Response as SResponse; use Swoole\Http\Response as SResponse;
/** /**
@@ -192,8 +189,11 @@ class Response extends HttpService
/** /**
* @param mixed $content * @param mixed $content
* @param int $statusCode
* @param null $format
* @return Response
*/ */
public function setContent(mixed $content, $statusCode = 200, $format = null): static public function setContent(mixed $content,int $statusCode = 200, $format = null): static
{ {
$this->endData = $content; $this->endData = $content;
$this->setStatusCode($statusCode); $this->setStatusCode($statusCode);
@@ -205,7 +205,7 @@ class Response extends HttpService
/** /**
* @return string * @return string
* @throws \ReflectionException * @throws \ReflectionException
* @throws \Snowflake\Exception\NotFindClassException * @throws NotFindClassException
*/ */
public function getContent(): string public function getContent(): string
{ {