| 1 | <?php |
||
| 20 | class Script extends AbstractHelper |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var RendererInterface |
||
| 24 | */ |
||
| 25 | private $renderer; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Initializes a new instance of this class. |
||
| 29 | * |
||
| 30 | * @param RendererInterface $renderer The analytics to render a script for. |
||
| 31 | */ |
||
| 32 | public function __construct(RendererInterface $renderer) |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Generates the script that is needed to make phpab work. |
||
| 39 | * |
||
| 40 | * @return string |
||
| 41 | */ |
||
| 42 | public function __invoke() |
||
| 50 | } |
||
| 51 |
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.