This commit is contained in:
as2252258@163.com
2021-08-04 03:00:23 +08:00
parent 9922f0ad60
commit fa09277f1f
+2 -2
View File
@@ -44,7 +44,7 @@ class Response extends HttpService
private mixed $endData;
private array $_format_maps = [
const FORMAT_MAPS = [
self::JSON => JsonFormatter::class,
self::XML => XmlFormatter::class,
self::HTML => HtmlFormatter::class
@@ -213,7 +213,7 @@ class Response extends HttpService
return $this->endData;
}
$class = $this->_format_maps[$this->format] ?? HtmlFormatter::class;
$class = Response::FORMAT_MAPS[$this->format] ?? HtmlFormatter::class;
return \di($class)->send($this->endData)->getData();
}