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