| 1 | <?php |
||
| 21 | class TwigEngine implements EngineInterface |
||
| 22 | { |
||
| 23 | protected $environment; |
||
| 24 | |||
| 25 | public function __construct(\Twig_Environment $environment) |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Add a template directory to look for template files inside. |
||
| 32 | * |
||
| 33 | * @param string $path The path to a template directory to load templates from. |
||
| 34 | * @return boolean |
||
| 35 | */ |
||
| 36 | public function addPath($path) |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Render the given template name and return the result as a string. |
||
| 57 | * |
||
| 58 | * @param string $templateName The name of the template to render |
||
| 59 | * @param array $parameters Any parameters to render the template with |
||
| 60 | * @return string |
||
| 61 | */ |
||
| 62 | public function render($templateName, array $parameters = array()) |
||
| 66 | } |
||
| 67 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.jsonfile (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.jsonto be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
requireorrequire-devsection?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceofchecks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.