1 | <?php |
||
25 | class Reflection extends ProxyDictionary implements ReflectionInterface |
||
26 | { |
||
27 | /** |
||
28 | * @var array|DocumentInterface[] |
||
29 | */ |
||
30 | protected $documents = []; |
||
31 | |||
32 | /** |
||
33 | * Reflection constructor. |
||
34 | * @param Dictionary|null $parent |
||
35 | * @throws ReflectionException |
||
36 | */ |
||
37 | 9 | public function __construct(Dictionary $parent = null) |
|
45 | |||
46 | /** |
||
47 | * @param \Closure $then |
||
48 | * @return mixed |
||
49 | * @throws ReflectionException |
||
50 | */ |
||
51 | 9 | private function wrap(\Closure $then) |
|
65 | |||
66 | /** |
||
67 | * @return void |
||
68 | * @throws Exception\TypeConflictException |
||
69 | */ |
||
70 | 9 | private function boot(): void |
|
74 | |||
75 | /** |
||
76 | * @param DocumentInterface $document |
||
77 | */ |
||
78 | 17 | public function addDocument(DocumentInterface $document): void |
|
82 | |||
83 | /** |
||
84 | * @return iterable |
||
85 | */ |
||
86 | 4 | public function getDocuments(): iterable |
|
90 | |||
91 | /** |
||
92 | * @param TypeDefinition $type |
||
93 | * @return Dictionary |
||
94 | */ |
||
95 | 17 | public function add(TypeDefinition $type): Dictionary |
|
101 | } |
||
102 |
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.