modify
This commit is contained in:
@@ -44,7 +44,7 @@ class Response extends HttpService
|
|||||||
|
|
||||||
private mixed $endData;
|
private mixed $endData;
|
||||||
|
|
||||||
private array $_format_maps = [
|
const FORMAT_MAPS = [
|
||||||
self::JSON => JsonFormatter::class,
|
self::JSON => JsonFormatter::class,
|
||||||
self::XML => XmlFormatter::class,
|
self::XML => XmlFormatter::class,
|
||||||
self::HTML => HtmlFormatter::class
|
self::HTML => HtmlFormatter::class
|
||||||
@@ -213,7 +213,7 @@ class Response extends HttpService
|
|||||||
return $this->endData;
|
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();
|
return \di($class)->send($this->endData)->getData();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user