for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace App\Controller;
use Slim\Container;
use Slim\Http\Response;
abstract class BaseController
{
/** @var Container */
protected $container;
public function __construct(Container $container)
$this->container = $container;
}
/**
* @param array|object|null $message
*/
protected function jsonResponse(
Response $response,
string $status,
$message,
int $code
): Response {
$result = [
'code' => $code,
'status' => $status,
'message' => $message,
];
return $response->withJson($result, $code, JSON_PRETTY_PRINT);
protected static function isRedisEnabled(): bool
return filter_var($_SERVER['REDIS_ENABLED'], FILTER_VALIDATE_BOOLEAN);
protected static function isLoggerEnabled(): bool
return filter_var($_SERVER['LOGS_ENABLED'], FILTER_VALIDATE_BOOLEAN);