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
BaseController 100.00% 5 / 5 100.00% 1 / 1 3 100.00% 1 / 1
 __invoke 100.00% 5 / 5 100.00% 1 / 1 2
 readResponse n/a 0 / 0 n/a 0 / 0 1
1<?php
2
3/**
4 * @package Zmsstatistic
5 * @copyright BerlinOnline Stadtportal GmbH & Co. KG
6 **/
7
8namespace BO\Zmsstatistic;
9
10use Psr\Http\Message\RequestInterface;
11use Psr\Http\Message\ResponseInterface;
12
13/**
14 * @SuppressWarnings(NumberOfChildren)
15 *
16 */
17abstract class BaseController extends Helper\Access
18{
19    #[\Override]
20    public function __invoke(RequestInterface $request, ResponseInterface $response, array $args)
21    {
22        $request = $this->initRequest($request);
23        if ($this->withAccess) {
24            $this->initAccessRights($request);
25        }
26        $noCacheResponse = \BO\Slim\Render::withLastModified($response, time(), '0');
27        return $this->readResponse($request, $noCacheResponse, $args);
28    }
29
30    /**
31     * @codeCoverageIgnore
32     *
33     */
34    public function readResponse(RequestInterface $request, ResponseInterface $response, array $args): mixed
35    {
36        return parent::__invoke($request, $response, $args);
37    }
38}