Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
TwigExceptionHandler | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
withHtml | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace BO\Zmscalldisplay\Helper; |
4 | |
5 | use Psr\Http\Message\RequestInterface; |
6 | use Psr\Http\Message\ResponseInterface; |
7 | |
8 | class 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 | if ($exception instanceof \Slim\Exception\HttpNotFoundException) { |
17 | \BO\Slim\Controller::prepareRequest($request); |
18 | return \BO\Slim\Render::withHtml($response, 'page/404.twig'); |
19 | } |
20 | return parent::withHtml($request, $response, $exception, $status); |
21 | } |
22 | } |