| Total Complexity | 4 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | abstract class BaseController |
||
| 11 | { |
||
| 12 | /** @var Container */ |
||
| 13 | protected $container; |
||
| 14 | |||
| 15 | 59 | public function __construct(Container $container) |
|
| 16 | { |
||
| 17 | 59 | $this->container = $container; |
|
| 18 | 59 | } |
|
| 19 | |||
| 20 | /** |
||
| 21 | * @param array|object|null $message |
||
| 22 | */ |
||
| 23 | 31 | protected function jsonResponse( |
|
| 24 | Response $response, |
||
| 25 | string $status, |
||
| 26 | $message, |
||
| 27 | int $code |
||
| 28 | ): Response { |
||
| 29 | $result = [ |
||
| 30 | 31 | 'code' => $code, |
|
| 31 | 31 | 'status' => $status, |
|
| 32 | 31 | 'message' => $message, |
|
| 33 | ]; |
||
| 34 | |||
| 35 | 31 | return $response->withJson($result, $code, JSON_PRETTY_PRINT); |
|
| 36 | } |
||
| 37 | |||
| 38 | 1 | protected static function isRedisEnabled(): bool |
|
| 41 | } |
||
| 42 | |||
| 43 | 1 | protected static function isLoggerEnabled(): bool |
|
| 48 |