Conditions | 3 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 6 | public function compile(QueryBuilder $queryBuilder): string |
|
21 | { |
||
22 | 6 | $this->expression->registerVariable($queryBuilder->getVariables()); |
|
23 | |||
24 | 6 | $this->expression = $this->expression->compile($queryBuilder); |
|
|
|||
25 | |||
26 | 6 | $queryBuilder->binds = array_unique(array_merge($queryBuilder->binds, $this->expression->binds)); |
|
27 | |||
28 | // Extract collections |
||
29 | 6 | if (isset($this->expression->collections)) { |
|
30 | 6 | foreach ($this->expression->collections as $mode => $collections) { |
|
31 | 1 | $queryBuilder->registerCollections($this->expression->collections[$mode], $mode); |
|
32 | } |
||
33 | } |
||
34 | |||
35 | 6 | return '(' . $this->expression . ')'; |
|
36 | } |
||
38 |
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.