Lines
100.00%
5 / 5
Functions and Methods
100.00%
1 / 1
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Healthcheck | 100.00% | 5 / 5 | 100.00% | 1 / 1 | 1 | 100.00% | 1 / 1 | |||
| __invoke | 100.00% | 5 / 5 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | /** | |
| 4 | * @package Zmsadmin | |
| 5 | * @copyright BerlinOnline Stadtportal GmbH & Co. KG | |
| 6 | **/ | |
| 7 | ||
| 8 | namespace BO\Zmsadmin; | |
| 9 | ||
| 10 | use BO\Slim\Render; | |
| 11 | use BO\Zmsclient\Status; | |
| 12 | use BO\Zmsentities\Schema\Entity; | |
| 13 | ||
| 14 | /** | |
| 15 | * Handle requests concerning services | |
| 16 | * | |
| 17 | */ | |
| 18 | class Healthcheck extends BaseController | |
| 19 | { | |
| 20 | /** | |
| 21 | * @SuppressWarnings(UnusedFormalParameter) | |
| 22 | */ | |
| 23 | #[\Override] | |
| 24 | public function __invoke( | |
| 25 | \Psr\Http\Message\RequestInterface $request, | |
| 26 | \Psr\Http\Message\ResponseInterface $response, | |
| 27 | array $args | |
| 28 | ) { | |
| 29 | $response = Status::testStatus($response, function (): Entity|false|null { | |
| 30 | return \App::$http->readGetResult('/status/', ['includeProcessStats' => 0])->getEntity(); | |
| 31 | }); | |
| 32 | $response = Render::withLastModified($response, time(), '0'); | |
| 33 | return $response; | |
| 34 | } | |
| 35 | } |