1 | <?php |
||
3 | class QueryCounterBehavior extends ModelBehavior { |
||
4 | |||
5 | private $runtime = array(); // @codingStandardsIgnoreLine |
||
6 | |||
7 | /** |
||
8 | * beforeFind |
||
9 | * |
||
10 | * @param Model $model Model |
||
11 | * @param array $query Query |
||
12 | * @return mixed |
||
13 | */ |
||
14 | public function beforeFind(Model $model, $query) { |
||
20 | |||
21 | /** |
||
22 | * afterFind |
||
23 | * |
||
24 | * @param Model $model Model |
||
25 | * @param array $results Results |
||
26 | * @param bool $primary Primary |
||
27 | * @return mixed |
||
28 | */ |
||
29 | public function afterFind(Model $model, $results, $primary = false) { |
||
45 | |||
46 | /** |
||
47 | * queryCount |
||
48 | * |
||
49 | * @param Model $model Model |
||
50 | * @return int |
||
51 | */ |
||
52 | public function queryCount(Model $model) { |
||
55 | |||
56 | } |
||
57 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to 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
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.