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 * @package Zmsstatistic
5 * @copyright BerlinOnline Stadtportal GmbH & Co. KG
6 **/
7
8namespace BO\Zmsstatistic;
9
10use BO\Slim\Render;
11use BO\Zmsentities\Schema\Entity;
12use Psr\Http\Message\RequestInterface;
13use Psr\Http\Message\ResponseInterface;
14
15class Healthcheck extends BaseController
16{
17    protected $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    ) {
30        $response = \BO\Zmsclient\Status::testStatus($response, function (): Entity|false|null {
31            return \App::$http->readGetResult('/status/', ['includeProcessStats' => 0])->getEntity();
32        });
33
34        return Render::withLastModified($response, time(), '0');
35    }
36}