Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
TwigExceptionHandler
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
1 / 1
 withHtml
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
2
1<?php
2
3namespace BO\Zmsticketprinter\Helper;
4
5use Psr\Http\Message\RequestInterface;
6use Psr\Http\Message\ResponseInterface;
7
8class TwigExceptionHandler extends \BO\Slim\TwigExceptionHandler
9{
10    public static function withHtml(
11        RequestInterface $request,
12        ResponseInterface $response,
13        \Throwable $exception,
14        $status = 500
15    ) {
16        $ticketprinterHash = \BO\Zmsclient\Ticketprinter::getHash();
17        if ($ticketprinterHash) {
18            // @codeCoverageIgnoreStart
19            $exception->templatedata = [
20                'hash' => $ticketprinterHash,
21            ];
22            // @codeCoverageIgnoreEnd
23        }
24        return parent::withHtml($request, $response, $exception, $status);
25    }
26}