GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

GeonamesAddress::withName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Geocoder package.
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license    MIT License
11
 */
12
13
namespace Geocoder\Provider\Geonames\Model;
14
15
use Geocoder\Model\Address;
16
17
/**
18
 * @author Tobias Nyholm <[email protected]>
19
 */
20
final class GeonamesAddress extends Address
21
{
22
    /**
23
     * @var string|null
24
     */
25
    private $fcode;
26
27
    /**
28
     * @var string|null
29
     */
30
    private $fclName;
31
32
    /**
33
     * @var int|null
34
     */
35
    private $population;
36
37
    /**
38
     * @var int|null
39
     */
40
    private $geonameId;
41
42
    /**
43
     * The name of this place.
44
     *
45
     * @var string|null
46
     */
47
    private $name;
48
49
    /**
50
     * @var array
51
     */
52
    private $alternateNames = [];
53
54
    /**
55
     * The name of this location.
56
     *
57
     * @var string|null
58
     */
59
    private $asciiName;
60
61
    /**
62
     * @return null|string
63
     */
64
    public function getName(): string
65
    {
66
        return $this->name;
67
    }
68
69
    /**
70
     * @param null|string $name
71
     *
72
     * @return self
73
     */
74
    public function withName(string $name = null): self
75
    {
76
        $new = clone $this;
77
        $new->name = $name;
78
79
        return $new;
80
    }
81
82
    /**
83
     * @return null|string
84
     */
85
    public function getFcode()
86
    {
87
        return $this->fcode;
88
    }
89
90
    /**
91
     * @param null|string $fcode
92
     *
93
     * @return GeonamesAddress
94
     */
95
    public function withFcode($fcode)
96
    {
97
        $new = clone $this;
98
        $new->fcode = $fcode;
99
100
        return $new;
101
    }
102
103
    /**
104
     * @return null|string
105
     */
106
    public function getFclName()
107
    {
108
        return $this->fclName;
109
    }
110
111
    /**
112
     * @param null|string $fclName
113
     *
114
     * @return GeonamesAddress
115
     */
116
    public function withFclName($fclName)
117
    {
118
        $new = clone $this;
119
        $new->fclName = $fclName;
120
121
        return $new;
122
    }
123
124
    /**
125
     * @return int|null
126
     */
127
    public function getPopulation()
128
    {
129
        return $this->population;
130
    }
131
132
    /**
133
     * @param int|null $population
134
     *
135
     * @return GeonamesAddress
136
     */
137
    public function withPopulation($population)
138
    {
139
        $new = clone $this;
140
        $new->population = $population;
141
142
        return $new;
143
    }
144
145
    /**
146
     * @return int|null
147
     */
148
    public function getGeonameId()
149
    {
150
        return $this->geonameId;
151
    }
152
153
    /**
154
     * @param int|null $geonameId
155
     *
156
     * @return GeonamesAddress
157
     */
158
    public function withGeonameId($geonameId)
159
    {
160
        $new = clone $this;
161
        $new->geonameId = $geonameId;
162
163
        return $new;
164
    }
165
166
    /**
167
     * @return array
168
     */
169
    public function getAlternateNames(): array
170
    {
171
        return $this->alternateNames;
172
    }
173
174
    /**
175
     * @param array $alternateNames
176
     *
177
     * @return GeonamesAddress
178
     */
179
    public function withAlternateNames(array $alternateNames)
180
    {
181
        $new = clone $this;
182
        $new->alternateNames = $alternateNames;
183
184
        return $new;
185
    }
186
187
    /**
188
     * @return null|string
189
     */
190
    public function getAsciiName()
191
    {
192
        return $this->asciiName;
193
    }
194
195
    /**
196
     * @param null|string $asciiName
197
     *
198
     * @return GeonamesAddress
199
     */
200
    public function withAsciiName($asciiName)
201
    {
202
        $new = clone $this;
203
        $new->asciiName = $asciiName;
204
205
        return $new;
206
    }
207
}
208