| @@ 65-74 (lines=10) @@ | ||
| 62 | * @param string $offset The offset to get |
|
| 63 | * @return mixed The value of the offset |
|
| 64 | */ |
|
| 65 | public function offsetGet($offset) { |
|
| 66 | if ($this->offsetExists($offset)) { |
|
| 67 | return $this->hsl[$offset]; |
|
| 68 | } |
|
| 69 | return error::trigger(error::INVALID_ARGUMENT, sprintf( |
|
| 70 | 'The offset "%s" does not exist in %s', |
|
| 71 | (string) $offset, |
|
| 72 | __CLASS__ |
|
| 73 | )); |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * Set a value in the data array |
|
| @@ 83-92 (lines=10) @@ | ||
| 80 | * @param mixed $value The value to set it to |
|
| 81 | * @return mixed The result |
|
| 82 | */ |
|
| 83 | public function offsetSet($offset, $value) { |
|
| 84 | if ($this->offsetExists($offset)) { |
|
| 85 | return $this->hsl[$offset] = (float) $value; |
|
| 86 | } |
|
| 87 | return error::trigger(error::INVALID_ARGUMENT, sprintf( |
|
| 88 | 'The offset "%s" cannot be set in %s', |
|
| 89 | (string) $offset, |
|
| 90 | __CLASS__ |
|
| 91 | )); |
|
| 92 | } |
|
| 93 | ||
| 94 | /** |
|
| 95 | * Reset an offset to 0 |
|