Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php namespace Mbh\Collection\Traits; |
||
36 | public static function fromItems(Traversable $array) |
||
37 | { |
||
38 | if (!$array instanceof CountableInterface) { |
||
39 | return static::fromArray(iterator_to_array($array)); |
||
40 | } |
||
41 | |||
42 | $sfa = new SplFixedArray(count($array)); |
||
43 | |||
44 | foreach ($array as $i => $elem) { |
||
45 | $sfa[$i] = $elem; |
||
46 | } |
||
47 | |||
48 | return new static($sfa); |
||
49 | } |
||
53 |
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.