| 1 | <?php |
||
| 12 | class ValuesCollection implements Countable, IteratorAggregate, ArrayAccess |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var array |
||
| 16 | */ |
||
| 17 | private $values; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * ValuesCollection constructor |
||
| 21 | * |
||
| 22 | * @param $values array |
||
| 23 | */ |
||
| 24 | 3 | public function __construct(array $values = array()) |
|
| 28 | |||
| 29 | /** |
||
| 30 | * Add a value to collection |
||
| 31 | * |
||
| 32 | * @param $key |
||
| 33 | * @param $value |
||
| 34 | * |
||
| 35 | * @return $this |
||
| 36 | */ |
||
| 37 | 3 | public function add($key, $value) |
|
| 43 | |||
| 44 | /** |
||
| 45 | * Return stored values |
||
| 46 | * |
||
| 47 | * @return array |
||
| 48 | */ |
||
| 49 | 3 | public function getValues() |
|
| 53 | |||
| 54 | /** |
||
| 55 | * {@inheritdoc} |
||
| 56 | */ |
||
| 57 | 1 | public function getIterator() |
|
| 61 | |||
| 62 | /** |
||
| 63 | * {@inheritdoc} |
||
| 64 | */ |
||
| 65 | 1 | public function offsetExists($offset) |
|
| 69 | |||
| 70 | /** |
||
| 71 | * {@inheritdoc} |
||
| 72 | */ |
||
| 73 | 1 | public function offsetGet($offset) |
|
| 77 | |||
| 78 | /** |
||
| 79 | * {@inheritdoc} |
||
| 80 | */ |
||
| 81 | 1 | public function offsetSet($offset, $value) |
|
| 85 | |||
| 86 | /** |
||
| 87 | * {@inheritdoc} |
||
| 88 | */ |
||
| 89 | 1 | public function offsetUnset($offset) |
|
| 93 | |||
| 94 | /** |
||
| 95 | * {@inheritdoc} |
||
| 96 | */ |
||
| 97 | 1 | public function count() |
|
| 101 | } |