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.
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.
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.
Loading history...
28
*/
29
1
public function reverse($areKeysPreserved = true)
30
{
31
1
return new $this(array_reverse((array)$this, $areKeysPreserved));
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.
Loading history...
37
*/
38
2
public function shuffle($areKeysPreserved = true)
39
{
40
2
if($areKeysPreserved){
41
1
return $this->sort(function(){
42
1
return mt_rand(-1, 1);
43
1
});
44
}
45
46
1
$collection = (array)$this;
47
1
shuffle($collection);
48
1
return new $this($collection);
49
}
50
51
/**
52
* @param callable $callback
53
* @return $this[]
54
*/
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) {
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.