Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php namespace Picqer\Financials\Exact\Query; |
||
34 | protected function collectionFromResult($result) |
||
35 | { |
||
36 | // If we have one result which is not an assoc array, make it the first element of an array for the |
||
37 | // collectionFromResult function so we always return a collection from filter |
||
38 | if ((bool) count(array_filter(array_keys($result), 'is_string'))) { |
||
39 | $result = [ $result ]; |
||
40 | } |
||
41 | |||
42 | $class = $this->class; |
||
43 | $collection = []; |
||
44 | |||
45 | foreach ($result as $r) { |
||
46 | $collection[] = new $class($this->connection, $r); |
||
47 | } |
||
48 | |||
49 | return $collection; |
||
50 | } |
||
52 |
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.