| @@ 36-46 (lines=11) @@ | ||
| 33 | * @param mixed $default |
|
| 34 | * @return mixed |
|
| 35 | */ |
|
| 36 | public function offsetGet($offset, $default = null) |
|
| 37 | { |
|
| 38 | if ($this instanceof \Traversable) { |
|
| 39 | foreach ($this as $key => $value) { |
|
| 40 | if ($key === $offset) { |
|
| 41 | return $value; |
|
| 42 | } |
|
| 43 | } |
|
| 44 | } |
|
| 45 | return $default; |
|
| 46 | } |
|
| 47 | ||
| 48 | /** |
|
| 49 | * Not implemented |
|
| @@ 36-46 (lines=11) @@ | ||
| 33 | * @param mixed $default |
|
| 34 | * @return mixed |
|
| 35 | */ |
|
| 36 | public function get($offset, $default = null) |
|
| 37 | { |
|
| 38 | if ($this instanceof \Traversable) { |
|
| 39 | foreach ($this as $key => $value) { |
|
| 40 | if ($key === $offset) { |
|
| 41 | return $value; |
|
| 42 | } |
|
| 43 | } |
|
| 44 | } |
|
| 45 | return $default; |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||