1 | <?php |
||
30 | class Type implements TypeInterface |
||
31 | { |
||
32 | /** |
||
33 | * @var Type[] |
||
34 | */ |
||
35 | private static $instances = []; |
||
36 | |||
37 | /** |
||
38 | * @var array[]|string[][] |
||
39 | */ |
||
40 | private static $inheritance = []; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $name; |
||
46 | |||
47 | /** |
||
48 | * @var array|string[] |
||
49 | */ |
||
50 | private $parent; |
||
51 | |||
52 | /** |
||
53 | * BaseType constructor. |
||
54 | * @param string $name |
||
55 | */ |
||
56 | private function __construct(string $name) |
||
63 | |||
64 | /** |
||
65 | * @param string $name |
||
66 | * @return array |
||
67 | */ |
||
68 | private function getInheritanceSequence(string $name): array |
||
76 | |||
77 | /** |
||
78 | * @param \SplStack $stack |
||
79 | * @param array $children |
||
80 | */ |
||
81 | private function bootInheritance(\SplStack $stack, array $children = []): void |
||
106 | |||
107 | /** |
||
108 | * @param string|ProvidesType $type |
||
109 | * @return TypeInterface |
||
110 | */ |
||
111 | public static function of($type): TypeInterface |
||
126 | |||
127 | /** |
||
128 | * {@inheritDoc} |
||
129 | */ |
||
130 | public function isInputable(): bool |
||
134 | |||
135 | /** |
||
136 | * {@inheritDoc} |
||
137 | */ |
||
138 | public function isReturnable(): bool |
||
142 | |||
143 | /** |
||
144 | * {@inheritDoc} |
||
145 | */ |
||
146 | public function isDependent(): bool |
||
150 | |||
151 | /** |
||
152 | * {@inheritDoc} |
||
153 | */ |
||
154 | public function instanceOf(TypeInterface $type): bool |
||
160 | |||
161 | /** |
||
162 | * {@inheritDoc} |
||
163 | */ |
||
164 | public function is(string $type): bool |
||
168 | |||
169 | /** |
||
170 | * {@inheritDoc} |
||
171 | */ |
||
172 | public function getName(): string |
||
176 | |||
177 | /** |
||
178 | * {@inheritDoc} |
||
179 | */ |
||
180 | public function __toString(): string |
||
184 | |||
185 | /** |
||
186 | * {@inheritDoc} |
||
187 | */ |
||
188 | public static function isValid(string $name): bool |
||
192 | |||
193 | /** |
||
194 | * @param string $name |
||
195 | * @param array $arguments |
||
196 | * @return TypeInterface |
||
197 | */ |
||
198 | public static function __callStatic(string $name, array $arguments = []) |
||
208 | |||
209 | /** |
||
210 | * @return array |
||
211 | */ |
||
212 | public static function all(): array |
||
216 | } |
||
217 |
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.