FlatDumper::toArray()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace Dwo\Aggregator\Dumper;
4
5
/**
6
 * Class FlatDumper
7
 *
8
 * @author Dave Www <[email protected]>
9
 */
10
class FlatDumper
11
{
12
    /**
13
     * @param \Iterator $group
14
     *
15
     * @return array
16
     */
17
    public static function toArray(\Iterator $group)
18
    {
19
        $dump = [];
20
21
        foreach ($group as $id => $aggregate) {
22
            $dump[$id] = $aggregate->getData();
23
        }
24
25
        return $dump;
26
    }
27
}