Conditions | 2 |
Paths | 2 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public static function render(\Exception $exception, Compiler $compiler) |
||
17 | { |
||
18 | $source = fs::getInternalResource('error.html.twig'); |
||
|
|||
19 | $template = $compiler->getTemplateBridge()->createTemplate($source); |
||
20 | |||
21 | if ($exception instanceof TemplateErrorInterface) |
||
22 | { |
||
23 | $message = [ |
||
24 | sprintf('File: %s:%d', $exception->getRelativeFilePath(), $exception->getTemplateLine()), |
||
25 | ]; |
||
26 | } |
||
27 | |||
28 | $message[] = $exception->getMessage(); |
||
29 | |||
30 | return $template->render([ |
||
31 | 'error_title' => 'Internal Server Error (500)', |
||
32 | 'error_exception' => get_class($exception), |
||
33 | 'error_message' => implode("\n\n", $message), |
||
34 | 'error_trace' => $exception->getTraceAsString(), |
||
35 | ]); |
||
36 | } |
||
37 | } |
||
38 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: