Total Complexity | 6 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class Collection |
||
8 | { |
||
9 | /** |
||
10 | * @var array |
||
11 | */ |
||
12 | private $items; |
||
13 | |||
14 | public function __construct(array $items) |
||
15 | { |
||
16 | $this->items = $items; |
||
17 | } |
||
18 | |||
19 | public function map(callable $cb) : self |
||
22 | } |
||
23 | |||
24 | public function filter(callable $cb) : self |
||
25 | { |
||
26 | return new self(filter($this->items, $cb)); |
||
27 | } |
||
28 | |||
29 | public function values() : self |
||
30 | { |
||
31 | return new self(array_values($this->items)); |
||
32 | } |
||
33 | |||
34 | public function each(callable $cb) : self |
||
35 | { |
||
36 | each($this->items, $cb); |
||
37 | |||
38 | return $this; |
||
39 | } |
||
40 | |||
41 | public function all() : array |
||
44 | } |
||
45 | } |
||
46 |