| 1 | <?php |
||
| 9 | final class FileSystemRenderTemplate implements Plates\RenderTemplate |
||
| 10 | { |
||
| 11 | private $hydrate; |
||
| 12 | private $include; |
||
| 13 | private $create_render_context; |
||
| 14 | private $render_context_var_name; |
||
| 15 | |||
| 16 | public function __construct( |
||
| 23 | |||
| 24 | public function renderTemplate(Plates\Template $template) { |
||
| 51 | } |
||
| 52 |
This error can happen if you refactor code and forget to move the variable initialization.
Let’s take a look at a simple example:
The above code is perfectly fine. Now imagine that we re-order the statements:
In that case,
$xwould be read before it is initialized. This was a very basic example, however the principle is the same for the found issue.