AddressComponent::getLongName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Arthem\GoogleApi\Domain\Place\VO;
4
5
class AddressComponent
6
{
7
    /**
8
     * @var string
9
     */
10
    private $longName;
11
12
    /**
13
     * @var string
14
     */
15
    private $shortName;
16
17
    /**
18
     * @var array
19
     */
20
    private $types;
21
22
    /**
23
     * @param string $longName
24
     * @param string $shortName
25
     * @param array  $types
26
     */
27
    public function __construct($longName, $shortName, array $types)
28
    {
29
        $this->longName = $longName;
30
        $this->shortName = $shortName;
31
        $this->types = $types;
32
    }
33
34
    /**
35
     * @return string
36
     */
37
    public function getLongName()
38
    {
39
        return $this->longName;
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getShortName()
46
    {
47
        return $this->shortName;
48
    }
49
50
    /**
51
     * @return array
52
     */
53
    public function getTypes()
54
    {
55
        return $this->types;
56
    }
57
58
    /**
59
     * @param string $type The requested type
60
     *
61
     * @return bool
62
     */
63
    public function hasType($type)
64
    {
65
        return in_array($type, $this->types, true);
66
    }
67
}
68