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