Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
55 | 1 | public function groupBy(callable $callback) |
|
56 | { |
||
57 | 1 | $results = []; |
|
58 | 1 | $collection = new Collection($this); |
|
59 | 1 | foreach ($collection->each($callback) as $key => $result) { |
|
60 | 1 | if (!isset($results[$result])) { |
|
61 | 1 | $results[$result] = new $this(); |
|
62 | 1 | } |
|
63 | 1 | $results[$result][$key] = $this[$key]; |
|
64 | 1 | } |
|
65 | 1 | return $results; |
|
66 | } |
||
67 | } |
||
68 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.