for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Controllers;
use App\Application;
abstract class BaseController
{
protected function createResponse($body, Application $app, $httpCode = 200)
$response = $app->getResponse($httpCode);
$response->getBody()->write($body);
$response->withHeader('Content-Length', strlen($body));
return $response;
}