feat(Dispatcher): Add debug log for controller methods returning raw data not wrapped in Response

Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
provokateurin 2024-11-15 10:09:59 +01:00
parent d61d62b64f
commit dd0ed02b91
No known key found for this signature in database

View file

@ -208,6 +208,10 @@ class Dispatcher {
$response = \call_user_func_array([$controller, $methodName], $arguments);
$this->eventLogger->end('controller:' . get_class($controller) . '::' . $methodName);
if (!($response instanceof Response)) {
$this->logger->debug($controller::class . '::' . $methodName . ' returned raw data. Please wrap it in a Response or one of it\'s inheritors.');
}
// format response
if ($response instanceof DataResponse || !($response instanceof Response)) {
// get format from the url format or request format parameter