AddressVO::getCountry()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace OutlookRestClient\Facade\Requests;
2
/**
3
 * Copyright 2017 OpenStack Foundation
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 * http://www.apache.org/licenses/LICENSE-2.0
8
 * Unless required by applicable law or agreed to in writing, software
9
 * distributed under the License is distributed on an "AS IS" BASIS,
10
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
 * See the License for the specific language governing permissions and
12
 * limitations under the License.
13
 **/
14
15
/**
16
 * Class AddressVO
17
 * @package OutlookRestClient\Facade\Requests
18
 */
19
final class AddressVO implements IValueObject
20
{
21
    /**
22
     * @var string
23
     */
24
    private $type;
25
26
    /**
27
     * @var string
28
     */
29
    private $street;
30
31
    /**
32
     * @var string
33
     */
34
    private $city;
35
36
    /**
37
     * @var string
38
     */
39
    private $state;
40
41
    /**
42
     * @var string
43
     */
44
    private $country;
45
46
    /**
47
     * @var string
48
     */
49
    private $postal_code;
50
51
    /**
52
     * AddressVO constructor.
53
     * @param string $street
54
     * @param string $city
55
     * @param string $state
56
     * @param string $country
57
     * @param string $postal_code
58
     * @param string $type
59
     */
60
    public function __construct($street, $city, $state, $country, $postal_code = null, $type = null)
61
    {
62
        $this->street      = $street;
63
        $this->city        = $city;
64
        $this->state       = $state;
65
        $this->country     = $country;
66
        $this->postal_code = $postal_code;
67
        $this->type        = $type;
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getType()
74
    {
75
        return $this->type;
76
    }
77
78
    /**
79
     * @return string
80
     */
81
    public function getStreet()
82
    {
83
        return $this->street;
84
    }
85
86
    /**
87
     * @return string
88
     */
89
    public function getCity()
90
    {
91
        return $this->city;
92
    }
93
94
    /**
95
     * @return string
96
     */
97
    public function getState()
98
    {
99
        return $this->state;
100
    }
101
102
    /**
103
     * @return string
104
     */
105
    public function getCountry()
106
    {
107
        return $this->country;
108
    }
109
110
    /**
111
     * @return string
112
     */
113
    public function getPostalCode()
114
    {
115
        return $this->postal_code;
116
    }
117
118
    /**
119
     * @return array
120
     */
121
    public function toArray()
122
    {
123
        return [
124
            'Type'            => $this->type,
125
            'Street'          => $this->street,
126
            'City'            => $this->city,
127
            'State'           => $this->state,
128
            'CountryOrRegion' => $this->country,
129
            'PostalCode'      => $this->postal_code,
130
        ];
131
    }
132
}