Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types = 1); |
||
21 | public function createIndex(string $indexName): void |
||
22 | { |
||
23 | $indexes = new Indexes(); |
||
24 | $indices = $indexes->getIndexes(); |
||
25 | |||
26 | /** @var \Suilven\FreeTextSearch\Index $indice */ |
||
27 | foreach ($indices as $indice) { |
||
28 | $clazz = $indice->getClass(); |
||
29 | $instance = \Singleton::getInstance($clazz); |
||
|
|||
30 | $classes = $instance->getClassAncestry(); |
||
31 | \error_log(\print_r($classes, true)); |
||
32 | |||
33 | foreach ($classes as $indiceClass) { |
||
34 | $fields = $indice->getFields(); |
||
35 | \error_log(\print_r($fields, 1)); |
||
36 | } |
||
40 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.