@@ 824-836 (lines=13) @@ | ||
821 | * @throws OutOfBoundsException if no default was provided and the key is |
|
822 | * not associated with a value. |
|
823 | */ |
|
824 | public function get($key, $default = null) |
|
825 | { |
|
826 | if (($pair = $this->lookupKey($key))) { |
|
827 | return $pair->value; |
|
828 | } |
|
829 | ||
830 | // Check if a default was provided. |
|
831 | if (func_num_args() === 1) { |
|
832 | throw new OutOfBoundsException(); |
|
833 | } |
|
834 | ||
835 | return $default; |
|
836 | } |
|
837 | ||
838 | /** |
|
839 | * Returns a set of all the keys in the map. |
@@ 277-289 (lines=13) @@ | ||
274 | * @throws OutOfBoundsException if no default was provided and the key is |
|
275 | * not associated with a value. |
|
276 | */ |
|
277 | public function get($key, $default = null) |
|
278 | { |
|
279 | if (($pair = $this->lookupKey($key))) { |
|
280 | return $pair->value; |
|
281 | } |
|
282 | ||
283 | // Check if a default was provided. |
|
284 | if (func_num_args() === 1) { |
|
285 | throw new OutOfBoundsException(); |
|
286 | } |
|
287 | ||
288 | return $default; |
|
289 | } |
|
290 | ||
291 | /** |
|
292 | * Returns a set of all the keys in the map. |