Total Complexity | 6 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 90.91% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
11 | trait FilterTrait |
||
12 | { |
||
13 | /** |
||
14 | * Get the first item from the collection passing the given truth test. |
||
15 | * |
||
16 | * @param callable|null $callback |
||
17 | * @param mixed $default |
||
18 | * @return mixed |
||
19 | */ |
||
20 | 1 | public function first(callable $callback = null, $default = null) |
|
23 | } |
||
24 | |||
25 | /** |
||
26 | * Get the items with the specified keys. |
||
27 | * |
||
28 | * @param mixed $keys |
||
29 | * @return static |
||
30 | */ |
||
31 | 1 | public function only($keys) |
|
38 | } |
||
39 | |||
40 | /** |
||
41 | * Splice a portion of the underlying collection array. |
||
42 | * |
||
43 | * @param int $offset |
||
44 | * @param int|null $length |
||
45 | * @param mixed $replacement |
||
46 | * @return static |
||
47 | */ |
||
48 | 1 | public function splice($offset, $length = null, $replacement = []) |
|
57 |
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.