AggregateGroup::toArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Dwo\Aggregator\Model;
4
5
use Dwo\Aggregator\Dumper\FlatDumper;
6
7
/**
8
 * Class AggregateGroup
9
 *
10
 * @author Dave Www <[email protected]>
11
 */
12
class AggregateGroup implements \Iterator
13
{
14
    use EntriesTrait;
15
16
    /**
17
     * @param Aggregate $aggregate
18
     */
19
    public function addAggregate(Aggregate $aggregate)
20
    {
21
        $this->entries[(string) $aggregate->getGroup()] = $aggregate;
22
    }
23
24
    /**
25
     * @return array
26
     */
27
    public function toArray()
28
    {
29
        return FlatDumper::toArray($this);
30
    }
31
}