Completed
Push — master ( e0fb88...aeef35 )
by Luke
01:50
created

LocationObject::setCounty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace ZpgRtf\Objects;
4
5
/**
6
 * Providing an accurate address and location for the property is incredibly important because a large number of
7
 * existing and future features on our websites depend on it. For example: which council is responsible for the
8
 * maintaining and taxing the local area; or average travel times between the property and other locations of interest
9
 * to the user.
10
 */
11
class LocationObject implements \JsonSerializable
12
{
13
    /** @var string */
14
    private $propertyNameOrNumber;
15
16
    /** @var string */
17
    private $streetName;
18
19
    /** @var string */
20
    private $locality;
21
22
    /** @var string */
23
    private $townOrCity;
24
25
    /** @var string */
26
    private $county;
27
28
    /** @var string */
29
    private $postalCode;
30
31
    /** @var string */
32
    private $countryCode;
33
34
    /** @var CoordinatesObject */
35
    private $coordinates;
36
37
    /** @var PafAddressObject */
38
    private $pafAddress;
39
40
    /** @var string */
41
    private $pafUdprn;
42
43
    /**
44
     * @return string
45
     */
46 2
    public function getPropertyNameOrNumber()
47
    {
48 2
        return $this->propertyNameOrNumber;
49
    }
50
51
    /**
52
     * @param string $propertyNameOrNumber
53
     *
54
     * @return LocationObject
55
     */
56 1
    public function setPropertyNameOrNumber($propertyNameOrNumber)
57
    {
58 1
        $this->propertyNameOrNumber = $propertyNameOrNumber;
59
60 1
        return $this;
61
    }
62
63
    /**
64
     * @return string
65
     */
66 2
    public function getStreetName()
67
    {
68 2
        return $this->streetName;
69
    }
70
71
    /**
72
     * @param string $streetName
73
     *
74
     * @return LocationObject
75
     */
76 1
    public function setStreetName($streetName)
77
    {
78 1
        $this->streetName = $streetName;
79
80 1
        return $this;
81
    }
82
83
    /**
84
     * @return string
85
     */
86 2
    public function getLocality()
87
    {
88 2
        return $this->locality;
89
    }
90
91
    /**
92
     * @param string $locality
93
     *
94
     * @return LocationObject
95
     */
96 1
    public function setLocality($locality)
97
    {
98 1
        $this->locality = $locality;
99
100 1
        return $this;
101
    }
102
103
    /**
104
     * @return string
105
     */
106 2
    public function getTownOrCity()
107
    {
108 2
        return $this->townOrCity;
109
    }
110
111
    /**
112
     * @param string $townOrCity
113
     *
114
     * @return LocationObject
115
     */
116 1
    public function setTownOrCity($townOrCity)
117
    {
118 1
        $this->townOrCity = $townOrCity;
119
120 1
        return $this;
121
    }
122
123
    /**
124
     * @return string
125
     */
126 2
    public function getCounty()
127
    {
128 2
        return $this->county;
129
    }
130
131
    /**
132
     * @param string $county
133
     *
134
     * @return LocationObject
135
     */
136 1
    public function setCounty($county)
137
    {
138 1
        $this->county = $county;
139
140 1
        return $this;
141
    }
142
143
    /**
144
     * @return string
145
     */
146 2
    public function getPostalCode()
147
    {
148 2
        return $this->postalCode;
149
    }
150
151
    /**
152
     * @param string $postalCode
153
     *
154
     * @return LocationObject
155
     */
156 1
    public function setPostalCode($postalCode)
157
    {
158 1
        $this->postalCode = $postalCode;
159
160 1
        return $this;
161
    }
162
163
    /**
164
     * @return string
165
     */
166 2
    public function getCountryCode()
167
    {
168 2
        return $this->countryCode;
169
    }
170
171
    /**
172
     * @param string $countryCode
173
     *
174
     * @return LocationObject
175
     */
176 1
    public function setCountryCode($countryCode)
177
    {
178 1
        $this->countryCode = $countryCode;
179
180 1
        return $this;
181
    }
182
183
    /**
184
     * @return CoordinatesObject
185
     */
186 2
    public function getCoordinates()
187
    {
188 2
        return $this->coordinates;
189
    }
190
191
    /**
192
     * @param CoordinatesObject $coordinates
193
     *
194
     * @return LocationObject
195
     */
196 1
    public function setCoordinates(CoordinatesObject $coordinates)
197
    {
198 1
        $this->coordinates = $coordinates;
199
200 1
        return $this;
201
    }
202
203
    /**
204
     * @return PafAddressObject
205
     */
206 2
    public function getPafAddress()
207
    {
208 2
        return $this->pafAddress;
209
    }
210
211
    /**
212
     * @param PafAddressObject $pafAddress
213
     *
214
     * @return LocationObject
215
     */
216 1
    public function setPafAddress(PafAddressObject $pafAddress)
217
    {
218 1
        $this->pafAddress = $pafAddress;
219
220 1
        return $this;
221
    }
222
223
    /**
224
     * @return string
225
     */
226 2
    public function getPafUdprn()
227
    {
228 2
        return $this->pafUdprn;
229
    }
230
231
    /**
232
     * @param string $pafUdprn
233
     *
234
     * @return LocationObject
235
     */
236 1
    public function setPafUdprn($pafUdprn)
237
    {
238 1
        $this->pafUdprn = $pafUdprn;
239
240 1
        return $this;
241
    }
242
243
    /** {@inheritDoc} */
244 1
    public function jsonSerialize()
245
    {
246
        return [
247 1
            'property_number_or_name' => $this->getPropertyNameOrNumber(),
248 1
            'street_name' => $this->getStreetName(),
249 1
            'locality' => $this->getLocality(),
250 1
            'town_or_city' => $this->getTownOrCity(),
251 1
            'county' => $this->getCounty(),
252 1
            'postal_code' => $this->getPostalCode(),
253 1
            'country_code' => $this->getCountryCode(),
254 1
            'coordinates' => $this->getCoordinates(),
255 1
            'paf_address' => $this->getPafAddress(),
256 1
            'paf_udprn' => $this->getPafUdprn(),
257
        ];
258
    }
259
}
260