ENH Improve scalar response handling
This resolves an issue where method_exists() was being called on scalar response values, which is not supported in PHP 8.
This commit is contained in:
parent
f00f64120d
commit
91f831cd0b
|
@ -230,7 +230,9 @@ class Controller extends RequestHandler implements TemplateGlobalProvider
|
|||
*/
|
||||
protected function prepareResponse($response)
|
||||
{
|
||||
if ($response instanceof HTTPResponse) {
|
||||
if (!is_object($response)) {
|
||||
$this->getResponse()->setBody($response);
|
||||
} elseif ($response instanceof HTTPResponse) {
|
||||
if (isset($_REQUEST['debug_request'])) {
|
||||
$class = static::class;
|
||||
Debug::message(
|
||||
|
|
Loading…
Reference in New Issue