Conditions | 2 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function getFunctions() |
||
27 | { |
||
28 | return [ |
||
29 | new ExpressionFunction('notFoundOnNull', function ($result) { |
||
30 | return sprintf('(null !== %1$s) ? %1$s : throw new NotFoundHttpException(\'Requested page is invalid.\')', $result); |
||
31 | }, function ($arguments, $result) { |
||
32 | if (null === $result) { |
||
33 | throw new NotFoundHttpException('Requested page is invalid.'); |
||
34 | } |
||
35 | |||
36 | return $result; |
||
37 | }), |
||
38 | ]; |
||
39 | } |
||
40 | } |
||
41 |