AggregateGroup   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addAggregate() 0 4 1
A toArray() 0 4 1
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
}