| @@ 66-74 (lines=9) @@ | ||
| 63 | /** |
|
| 64 | * {@inheritDoc} |
|
| 65 | */ |
|
| 66 | public function get($key, $defaultValue = NULL) { |
|
| 67 | $this->checkKeyType($key); |
|
| 68 | ||
| 69 | if(!$this->containsKey($key)) { |
|
| 70 | return $defaultValue; |
|
| 71 | } |
|
| 72 | ||
| 73 | return $this->data[$key]; |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * {@inheritDoc} |
|
| @@ 135-145 (lines=11) @@ | ||
| 132 | /** |
|
| 133 | * {@inheritDoc} |
|
| 134 | */ |
|
| 135 | public function putIfAbsent($key, $value) { |
|
| 136 | $this->checkKeyType($key); |
|
| 137 | ||
| 138 | if($this->containsKey($key)) { |
|
| 139 | return $this->get($key); |
|
| 140 | } |
|
| 141 | ||
| 142 | $this->put($key, $value); |
|
| 143 | ||
| 144 | return NULL; |
|
| 145 | } |
|
| 146 | ||
| 147 | /** |
|
| 148 | * {@inheritDoc} |
|
| @@ 150-161 (lines=12) @@ | ||
| 147 | /** |
|
| 148 | * {@inheritDoc} |
|
| 149 | */ |
|
| 150 | public function remove($key) { |
|
| 151 | $this->checkKeyType($key); |
|
| 152 | ||
| 153 | if($this->containsKey($key)) { |
|
| 154 | $previousElement = $this->get($key); |
|
| 155 | unset($this->data[$key]); |
|
| 156 | ||
| 157 | return $previousElement; |
|
| 158 | } |
|
| 159 | ||
| 160 | return NULL; |
|
| 161 | } |
|
| 162 | ||
| 163 | /** |
|
| 164 | * {@inheritDoc} |
|