| 1 | <?php |
||
| 15 | abstract class AbstractCollection implements Collection |
||
| 16 | { |
||
| 17 | /** @var array */ |
||
| 18 | protected $data; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param array $data |
||
| 22 | */ |
||
| 23 | 111 | public function __construct(array $data = []) |
|
| 27 | |||
| 28 | /** |
||
| 29 | * @return $this |
||
| 30 | */ |
||
| 31 | 1 | public function clear() |
|
| 37 | |||
| 38 | /** |
||
| 39 | * @return Psi |
||
| 40 | */ |
||
| 41 | 1 | public function psi() |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @return array |
||
| 48 | */ |
||
| 49 | 72 | public function getData() |
|
| 53 | |||
| 54 | /** |
||
| 55 | * @return int |
||
| 56 | */ |
||
| 57 | 15 | public function count() |
|
| 61 | |||
| 62 | /** |
||
| 63 | * @return bool |
||
| 64 | */ |
||
| 65 | 3 | public function isEmpty() |
|
| 66 | { |
||
| 67 | 3 | return $this->count() === 0; |
|
| 68 | } |
||
| 69 | |||
| 70 | /** |
||
| 71 | * @deprecated Use psi() instead as it will be removed in v1.1.0 |
||
| 72 | * |
||
| 73 | * @see psi() |
||
| 74 | * |
||
| 75 | * @param callable|UnaryFunction|BinaryFunction $predicate |
||
| 76 | * |
||
| 77 | * @return static |
||
| 78 | */ |
||
| 79 | 1 | public function filter($predicate) |
|
| 87 | } |
||
| 88 |