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