Completed
Pull Request — master (#3)
by Arthur
02:31
created

PhotoCollection   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

3 Methods

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