Lines 16.66% 3 / 18
Methods 50.00% 1 / 2
Classes 0.00% 0 / 1
Name Lines Methods CRAP
 readResponse 0.00% 0 / 15 0.00% 0 / 1 6
 [BO\Zmsticketprinter\BaseController] __invoke 100.00% 3 / 3 100.00% 1 / 1 1
17class Status extends BaseController
18{
19    /**
20     * @SuppressWarnings(UnusedFormalParameter)
21     * @return \Psr\Http\Message\ResponseInterface
22     */
23    #[\Override]
24    public function readResponse(
25        \Psr\Http\Message\RequestInterface $request,
26        \Psr\Http\Message\ResponseInterface $response,
27        array $args
28    ) {
29        $status['homeurl'] = Home::getHomeUrl($request);
30        $status['hash'] = Helper::getHashFromRequest($request);
31        if ($status['hash']) {
32            $status['ticketprinter'] = \App::$http
33                ->readGetResult('/ticketprinter/' . $status['hash'] . '/')
34                ->getEntity();
35        }
36
37        return \BO\Slim\Render::withHtml(
38            $response,
39            'page/status.twig',
40            array(
41                'title' => 'Status des Ticketprinter',
42                'status' => $status,
43                'cookies' => $request->getCookieParams()
44            )
45        );
46    }
47}

Inherited from BO\Zmsticketprinter\BaseController

21    public function __invoke(RequestInterface $request, ResponseInterface $response, array $args)
22    {
23        $request = $this->initRequest($request);
24        $noCacheResponse = \BO\Slim\Render::withLastModified($response, time(), '0');
25        return $this->readResponse($request, $noCacheResponse, $args);
26    }