改名
This commit is contained in:
@@ -194,10 +194,13 @@ class Response extends HttpService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $content
|
* @param mixed $content
|
||||||
* @return Response
|
* @return Response|\Server\Constrict\Response
|
||||||
*/
|
*/
|
||||||
public function setContent(mixed $content): static
|
public function setContent(mixed $content): Response|\Server\Constrict\Response
|
||||||
{
|
{
|
||||||
|
if ($content instanceof \Server\Constrict\Response) {
|
||||||
|
return $content;
|
||||||
|
}
|
||||||
$this->endData = $content;
|
$this->endData = $content;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@@ -213,13 +216,9 @@ class Response extends HttpService
|
|||||||
if (empty($this->endData) || is_string($this->endData)) {
|
if (empty($this->endData) || is_string($this->endData)) {
|
||||||
return $this->endData;
|
return $this->endData;
|
||||||
}
|
}
|
||||||
var_dump($this->endData);
|
|
||||||
if (!($this->endData instanceof Response)) {
|
|
||||||
$class = Response::FORMAT_MAPS[$this->format] ?? HtmlFormatter::class;
|
$class = Response::FORMAT_MAPS[$this->format] ?? HtmlFormatter::class;
|
||||||
return \di($class)->send($this->endData)->getData();
|
return \di($class)->send($this->endData)->getData();
|
||||||
}
|
}
|
||||||
return $this->endData->getContent();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user