@@ 41-60 (lines=20) @@ | ||
38 | * @param array $list |
|
39 | * @return array |
|
40 | */ |
|
41 | public function resolve($list) |
|
42 | { |
|
43 | if ($list instanceof Node) { |
|
44 | $list = $list->getResult(); |
|
45 | } |
|
46 | ||
47 | if (is_array($list)) { |
|
48 | foreach ($list as &$item) { |
|
49 | if ($item instanceof Node) { |
|
50 | $item = $item->getResult(); |
|
51 | } |
|
52 | ||
53 | if ($item instanceof \Traversable) { |
|
54 | $item = iterator_to_array($item); |
|
55 | } |
|
56 | } |
|
57 | } |
|
58 | ||
59 | return $list; |
|
60 | } |
|
61 | ||
62 | /** |
|
63 | * Merge properties of an object |
@@ 41-60 (lines=20) @@ | ||
38 | * @param array $list |
|
39 | * @return array |
|
40 | */ |
|
41 | public function resolve($list) |
|
42 | { |
|
43 | if ($list instanceof Node) { |
|
44 | $list = $list->getResult(); |
|
45 | } |
|
46 | ||
47 | if (is_array($list)) { |
|
48 | foreach ($list as &$item) { |
|
49 | if ($item instanceof Node) { |
|
50 | $item = $item->getResult(); |
|
51 | } |
|
52 | ||
53 | if ($item instanceof \Traversable) { |
|
54 | $item = iterator_to_array($item); |
|
55 | } |
|
56 | } |
|
57 | } |
|
58 | ||
59 | return $list; |
|
60 | } |
|
61 | ||
62 | /** |
|
63 | * Calculate sum |