| @@ 106-117 (lines=12) @@ | ||
| 103 | /** |
|
| 104 | * {@inheritDoc} |
|
| 105 | */ |
|
| 106 | public function put($key, $value) { |
|
| 107 | $this->checkKeyType($key); |
|
| 108 | $return = NULL; |
|
| 109 | ||
| 110 | if($this->containsKey($key)) { |
|
| 111 | $return = $this->get($key); |
|
| 112 | } |
|
| 113 | ||
| 114 | $this->data[$key] = $value; |
|
| 115 | ||
| 116 | return $return; |
|
| 117 | } |
|
| 118 | ||
| 119 | /** |
|
| 120 | * {@inheritDoc} |
|
| @@ 182-193 (lines=12) @@ | ||
| 179 | /** |
|
| 180 | * {@inheritDoc} |
|
| 181 | */ |
|
| 182 | public function replace($key, $value) { |
|
| 183 | $this->checkKeyType($key); |
|
| 184 | ||
| 185 | if($this->containsKey($key)) { |
|
| 186 | $previousValue = $this->get($key); |
|
| 187 | $this->data[$key] = $value; |
|
| 188 | ||
| 189 | return $previousValue; |
|
| 190 | } |
|
| 191 | ||
| 192 | return NULL; |
|
| 193 | } |
|
| 194 | ||
| 195 | /** |
|
| 196 | * {@inheritDoc} |
|