| @@ 18-27 (lines=10) @@ | ||
| 15 | * |
|
| 16 | * @return array |
|
| 17 | */ |
|
| 18 | public function items() |
|
| 19 | { |
|
| 20 | $items = []; |
|
| 21 | if ($this instanceof \Traversable) { |
|
| 22 | foreach ($this as $key => $value) { |
|
| 23 | $items [] = new KeyValuePair($key, $value instanceof FiniteIterableInterface ? $value->items() : $value); |
|
| 24 | } |
|
| 25 | } |
|
| 26 | return $items; |
|
| 27 | } |
|
| 28 | } |
|
| 29 | ||
| @@ 17-26 (lines=10) @@ | ||
| 14 | * |
|
| 15 | * @return array |
|
| 16 | */ |
|
| 17 | public function values() |
|
| 18 | { |
|
| 19 | $values = []; |
|
| 20 | if ($this instanceof \Traversable) { |
|
| 21 | foreach ($this as $key => $value) { |
|
| 22 | $values [] = $value instanceof FiniteIterableInterface ? $value->values() : $value; |
|
| 23 | } |
|
| 24 | } |
|
| 25 | return $values; |
|
| 26 | } |
|
| 27 | } |
|
| 28 | ||