| @@ 39-50 (lines=12) @@ | ||
| 36 | /** |
|
| 37 | * {@inheritDoc} |
|
| 38 | */ |
|
| 39 | public function offsetGet($offset) |
|
| 40 | { |
|
| 41 | if ($offset === 0 || $offset === 'key') { |
|
| 42 | return $this->key; |
|
| 43 | } |
|
| 44 | ||
| 45 | if ($offset === 1 || $offset === 'value') { |
|
| 46 | return $this->value; |
|
| 47 | } |
|
| 48 | ||
| 49 | throw new \InvalidArgumentException('$OFFSET must be either 0, 1, "key", or "value"'); |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * {@inheritDoc} |
|
| @@ 55-68 (lines=14) @@ | ||
| 52 | /** |
|
| 53 | * {@inheritDoc} |
|
| 54 | */ |
|
| 55 | public function offsetSet($offset, $value) |
|
| 56 | { |
|
| 57 | if ($offset === 0 || $offset === 'key') { |
|
| 58 | $this->key = $value; |
|
| 59 | return; |
|
| 60 | } |
|
| 61 | ||
| 62 | if ($offset === 1 || $offset === 'value') { |
|
| 63 | $this->value = $value; |
|
| 64 | return; |
|
| 65 | } |
|
| 66 | ||
| 67 | throw new \InvalidArgumentException('$OFFSET must be either 0, 1, "key", or "value"'); |
|
| 68 | } |
|
| 69 | ||
| 70 | /** |
|
| 71 | * {@inheritDoc} |
|