Completed
Pull Request — master (#244)
by Łukasz
11:47
created

DisplayView   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A add() 0 4 1
A getIterator() 0 4 1
1
<?php
2
3
/**
4
 * (c) FSi sp. z o.o. <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace FSi\Bundle\AdminBundle\Display;
11
12
use FSi\Bundle\AdminBundle\Display\Property\View;
13
14
class DisplayView implements \IteratorAggregate
15
{
16
    /**
17
     * @var View[]
18
     */
19
    protected $properties;
20
21
    public function __construct()
22
    {
23
        $this->properties = array();
24
    }
25
26
    /**
27
     * @param \FSi\Bundle\AdminBundle\Display\Property\View $propertyView
28
     */
29
    public function add(View $propertyView)
30
    {
31
        $this->properties[] = $propertyView;
32
    }
33
34
    /**
35
     * @return \ArrayIterator|\Traversable
36
     */
37
    public function getIterator()
38
    {
39
        return new \ArrayIterator($this->properties);
40
    }
41
}
42