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