PlaceCollection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A addPlace() 0 6 1
A getIterator() 0 4 1
1
<?php
2
3
namespace Arthem\GoogleApi\Domain\Place\VO;
4
5
use Arthem\GoogleApi\Domain\Place\Place;
6
7
class PlaceCollection implements \IteratorAggregate
8
{
9
    /**
10
     * @var Place[]
11
     */
12
    private $places = [];
13
14
    /**
15
     * @param Place[] $places
16
     */
17
    public function __construct(array $places = [])
18
    {
19
        $this->places = $places;
20
    }
21
22
    /**
23
     * @param Place $place
24
     *
25
     * @return $this
26
     */
27
    public function addPlace(Place $place)
28
    {
29
        $this->places[] = $place;
30
31
        return $this;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function getIterator()
38
    {
39
        return new \ArrayIterator($this->places);
40
    }
41
}
42