| @@ 133-144 (lines=12) @@ | ||
| 130 | /** |
|
| 131 | * {@inheritDoc} |
|
| 132 | */ |
|
| 133 | public function put($key, $value) { |
|
| 134 | $this->checkKeyType($key); |
|
| 135 | $return = NULL; |
|
| 136 | ||
| 137 | if($this->containsKey($key)) { |
|
| 138 | $return = $this->get($key); |
|
| 139 | } |
|
| 140 | ||
| 141 | $this->data[$key] = $value; |
|
| 142 | ||
| 143 | return $return; |
|
| 144 | } |
|
| 145 | ||
| 146 | /** |
|
| 147 | * {@inheritDoc} |
|
| @@ 209-220 (lines=12) @@ | ||
| 206 | /** |
|
| 207 | * {@inheritDoc} |
|
| 208 | */ |
|
| 209 | public function replace($key, $value) { |
|
| 210 | $this->checkKeyType($key); |
|
| 211 | ||
| 212 | if($this->containsKey($key)) { |
|
| 213 | $previousValue = $this->get($key); |
|
| 214 | $this->data[$key] = $value; |
|
| 215 | ||
| 216 | return $previousValue; |
|
| 217 | } |
|
| 218 | ||
| 219 | return NULL; |
|
| 220 | } |
|
| 221 | ||
| 222 | /** |
|
| 223 | * {@inheritDoc} |
|