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 115Mandant
6 * @copyright BerlinOnline Stadtportal GmbH & Co. KG
7 *
8 */
9
10namespace BO\Zmsticketprinter;
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    #[\Override]
28    public function readResponse(
29        RequestInterface $request,
30        ResponseInterface $response,
31        array $args
32    ) {
33        $response = Status::testStatus($response, function (): Entity|false|null {
34            return \App::$http->readGetResult('/status/', ['includeProcessStats' => 0])->getEntity();
35        });
36
37        return Render::withLastModified($response, time(), '0');
38    }
39}