1 | <?php |
||
28 | abstract class AbstractResourceLocator |
||
29 | { |
||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $srcPath; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $specPath; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $srcNamespace; |
||
44 | |||
45 | /** |
||
46 | * @var string |
||
47 | */ |
||
48 | protected $specNamespace; |
||
49 | |||
50 | /** |
||
51 | * @var string |
||
52 | */ |
||
53 | protected $fullSrcPath; |
||
54 | |||
55 | /** |
||
56 | * @var string |
||
57 | */ |
||
58 | protected $fullSpecPath; |
||
59 | |||
60 | /** |
||
61 | * @var Filesystem |
||
62 | */ |
||
63 | protected $filesystem; |
||
64 | |||
65 | /** |
||
66 | * @var string |
||
67 | */ |
||
68 | protected $codePool; |
||
69 | |||
70 | /** |
||
71 | * @param string $srcNamespace |
||
72 | * @param string $specNamespacePrefix |
||
73 | * @param string $srcPath |
||
74 | * @param string $specPath |
||
75 | * @param Filesystem $filesystem |
||
76 | * @param string $codePool |
||
77 | */ |
||
78 | public function __construct( |
||
98 | |||
99 | /** |
||
100 | * @return string |
||
101 | */ |
||
102 | public function getFullSrcPath() |
||
106 | |||
107 | /** |
||
108 | * @return string |
||
109 | */ |
||
110 | public function getFullSpecPath() |
||
114 | |||
115 | /** |
||
116 | * @return string |
||
117 | */ |
||
118 | public function getSrcNamespace() |
||
122 | |||
123 | /** |
||
124 | * @return string |
||
125 | */ |
||
126 | public function getSpecNamespace() |
||
130 | |||
131 | /** |
||
132 | * @return string |
||
133 | */ |
||
134 | public function getCodePool() |
||
138 | |||
139 | /** |
||
140 | * @return array |
||
141 | */ |
||
142 | public function getAllResources() |
||
146 | |||
147 | /** |
||
148 | * @param string $query |
||
149 | * @return bool |
||
150 | */ |
||
151 | public function supportsQuery($query) |
||
155 | |||
156 | /** |
||
157 | * @param string $query |
||
158 | * @return array |
||
159 | */ |
||
160 | public function findResources($query) |
||
179 | |||
180 | /** |
||
181 | * @param string $classname |
||
182 | * @return bool |
||
183 | */ |
||
184 | public function supportsClass($classname) |
||
197 | |||
198 | /** |
||
199 | * @param string $classname |
||
200 | * @return ResourceInterface |
||
201 | */ |
||
202 | public function createResource($classname) |
||
215 | |||
216 | /** |
||
217 | * @return int |
||
218 | */ |
||
219 | abstract public function getPriority(); |
||
220 | |||
221 | /** |
||
222 | * @param string $path |
||
223 | * @return array |
||
224 | */ |
||
225 | protected function findSpecResources($path) |
||
249 | |||
250 | /** |
||
251 | * @param string $path |
||
252 | * @return ResourceInterface |
||
253 | */ |
||
254 | private function createResourceFromSpecFile($path) |
||
260 | |||
261 | /** |
||
262 | * @param string $srcPath |
||
263 | * @param string $specPath |
||
264 | * @throws \InvalidArgumentException |
||
265 | */ |
||
266 | private function validatePaths($srcPath, $specPath) |
||
284 | |||
285 | /** |
||
286 | * @param string $query |
||
287 | * @return string |
||
288 | */ |
||
289 | private function getCleanPath($query) |
||
299 | |||
300 | /** |
||
301 | * @param array $matches |
||
302 | * @return string |
||
303 | */ |
||
304 | private function getClassnameFromMatches(array $matches) |
||
311 | |||
312 | /** |
||
313 | * @param array $matches |
||
314 | * @return string |
||
315 | */ |
||
316 | protected function getObjectName(array $matches) |
||
320 | |||
321 | /** |
||
322 | * @param string $path |
||
323 | * @return string |
||
324 | */ |
||
325 | protected function getRelative($path) |
||
331 | |||
332 | /** |
||
333 | * @param string $file |
||
334 | * @return bool |
||
335 | */ |
||
336 | abstract protected function isSupported($file); |
||
337 | |||
338 | /** |
||
339 | * @param array $parts |
||
340 | * @param ResourceLocatorInterface $locator |
||
341 | * @return ResourceInterface |
||
342 | */ |
||
343 | abstract protected function getResource(array $parts, ResourceLocatorInterface $locator); |
||
344 | |||
345 | /** |
||
346 | * @return string |
||
347 | */ |
||
348 | abstract protected function getClassType(); |
||
349 | |||
350 | /** |
||
351 | * @return string |
||
352 | */ |
||
353 | abstract protected function getValidator(); |
||
354 | } |
||
355 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: