Conditions | 7 |
Paths | 4 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 7 |
Changes | 0 |
1 | <?php |
||
47 | 15 | private function pullFromEntities(array $entities) |
|
48 | { |
||
49 | 15 | $events = []; |
|
50 | |||
51 | 15 | foreach ($entities as $entity) { |
|
52 | // ignore Doctrine not initialized proxy classes |
||
53 | // proxy class can't have a domain events |
||
54 | if ( |
||
55 | 14 | ($entity instanceof Proxy && !$entity->__isInitialized()) || |
|
56 | 14 | ($entity instanceof CommonProxy && !$entity->__isInitialized()) |
|
|
|||
57 | ) { |
||
58 | 14 | continue; |
|
59 | } |
||
60 | |||
61 | 14 | if ($entity instanceof AggregateEvents) { |
|
62 | 14 | $events = array_merge($events, $entity->pullEvents()); |
|
63 | } |
||
64 | } |
||
65 | |||
66 | 15 | return $events; |
|
67 | } |
||
68 | } |
||
69 |
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.