| 1 | <?php namespace BuildR\Collection\Collection; |
||
| 18 | abstract class AbstractCollection implements CollectionInterface { |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @type array |
||
| 22 | */ |
||
| 23 | protected $data = []; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * {@inheritdoc} |
||
| 27 | */ |
||
| 28 | 39 | public function toArray() { |
|
| 29 | 39 | return (array) $this->data; |
|
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * {@inheritdoc} |
||
| 34 | */ |
||
| 35 | 2 | public function clear() { |
|
| 36 | 2 | $this->data = []; |
|
| 37 | 2 | } |
|
| 38 | |||
| 39 | /** |
||
| 40 | * {@inheritdoc} |
||
| 41 | */ |
||
| 42 | 1 | public function isEmpty() { |
|
| 43 | 1 | return empty($this->data); |
|
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * {@inheritdoc} |
||
| 48 | */ |
||
| 49 | 59 | public function size() { |
|
| 50 | 59 | return (is_array($this->data)) ? count($this->data) : 0; |
|
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * {@inheritdoc} |
||
| 55 | * |
||
| 56 | * @codeCoverageIgnore |
||
| 57 | */ |
||
| 58 | public function current() { |
||
| 61 | |||
| 62 | /** |
||
| 63 | * {@inheritdoc} |
||
| 64 | * |
||
| 65 | * @codeCoverageIgnore |
||
| 66 | */ |
||
| 67 | public function next() { |
||
| 70 | |||
| 71 | /** |
||
| 72 | * {@inheritdoc} |
||
| 73 | * |
||
| 74 | * @codeCoverageIgnore |
||
| 75 | */ |
||
| 76 | public function key() { |
||
| 79 | |||
| 80 | /** |
||
| 81 | * {@inheritdoc} |
||
| 82 | * |
||
| 83 | * @codeCoverageIgnore |
||
| 84 | */ |
||
| 85 | public function valid() { |
||
| 88 | |||
| 89 | /** |
||
| 90 | * {@inheritdoc} |
||
| 91 | * |
||
| 92 | * @codeCoverageIgnore |
||
| 93 | */ |
||
| 94 | public function rewind() { |
||
| 97 | |||
| 98 | /** |
||
| 99 | * {@inheritdoc} |
||
| 100 | */ |
||
| 101 | 40 | public function count() { |
|
| 104 | |||
| 105 | /** |
||
| 106 | * @param array|\BuildR\Collection\Collection\CollectionInterface $elements |
||
| 107 | * |
||
| 108 | * @return array |
||
| 109 | */ |
||
| 110 | 36 | protected function collectionToArray($elements) { |
|
| 117 | |||
| 118 | } |
||
| 119 |