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