1 | <?php |
||
4 | trait CollectionFilterTrait |
||
5 | { |
||
6 | /** |
||
7 | * @param callable|null $filter |
||
8 | * @param int $flag (only for php version >= 5.6) |
||
9 | * @return $this |
||
|
|||
10 | */ |
||
11 | 1 | public function filter(callable $filter = null, $flag = 0) |
|
24 | |||
25 | /** |
||
26 | * Executes the callback for every value. |
||
27 | * Returns a collection with the result of each callback call. |
||
28 | * |
||
29 | * @param callable $callback |
||
30 | * @param array $args |
||
31 | * @return $this |
||
32 | */ |
||
33 | 3 | public function each(callable $callback, array $args = []) |
|
42 | |||
43 | /** |
||
44 | * Extracts the sequence of elements. |
||
45 | * Starts at index $startIndex and stop after $length keys. |
||
46 | * |
||
47 | * @param int $startIndex |
||
48 | * @param int $length |
||
49 | * @param bool $areKeysPreserved |
||
50 | * @return mixed |
||
51 | */ |
||
52 | 3 | public function extract($startIndex, $length = 0, $areKeysPreserved = true) |
|
58 | |||
59 | /** |
||
60 | * @param int $length |
||
61 | * @return $this |
||
62 | */ |
||
63 | 1 | public function rand($length = 1) |
|
74 | } |
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.