| @@ 26-33 (lines=8) @@ | ||
| 23 | * @param string $key |
|
| 24 | * @return string|null Header value |
|
| 25 | */ |
|
| 26 | public function offsetGet($key) { |
|
| 27 | $key = strtolower($key); |
|
| 28 | if (!isset($this->data[$key])) { |
|
| 29 | return null; |
|
| 30 | } |
|
| 31 | ||
| 32 | return $this->flatten($this->data[$key]); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * Set the given item |
|
| @@ 63-70 (lines=8) @@ | ||
| 60 | * @param string $key |
|
| 61 | * @return array|null Header values |
|
| 62 | */ |
|
| 63 | public function getValues($key) { |
|
| 64 | $key = strtolower($key); |
|
| 65 | if (!isset($this->data[$key])) { |
|
| 66 | return null; |
|
| 67 | } |
|
| 68 | ||
| 69 | return $this->data[$key]; |
|
| 70 | } |
|
| 71 | ||
| 72 | /** |
|
| 73 | * Flattens a value into a string |
|
| @@ 51-58 (lines=8) @@ | ||
| 48 | * @param string $key Item key |
|
| 49 | * @return string|null Item value (null if offsetExists is false) |
|
| 50 | */ |
|
| 51 | public function offsetGet($key) { |
|
| 52 | $key = strtolower($key); |
|
| 53 | if (!isset($this->data[$key])) { |
|
| 54 | return null; |
|
| 55 | } |
|
| 56 | ||
| 57 | return $this->data[$key]; |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * Set the given item |
|