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.
Completed
Push — place-services ( fedba7 )
by Eric
03:31
created

Review::getRating()   A

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
/*
4
 * This file is part of the Ivory Google Map package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\GoogleMap\Service\Place\Base;
13
14
/**
15
 * @author GeLo <[email protected]>
16
 */
17
class Review
18
{
19
    /**
20
     * @var string|null
21
     */
22
    private $authorName;
23
24
    /**
25
     * @var string|null
26
     */
27
    private $authorUrl;
28
29
    /**
30
     * @var string|null
31
     */
32
    private $text;
33
34
    /**
35
     * @var float|null
36
     */
37
    private $rating;
38
39
    /**
40
     * @var \DateTime|null
41
     */
42
    private $time;
43
44
    /**
45
     * @var string|null
46
     */
47
    private $language;
48
49
    /**
50
     * @var AspectRating[]
51
     */
52
    private $aspects = [];
53
54
    /**
55
     * @return bool
56
     */
57
    public function hasAuthorName()
58
    {
59
        return $this->authorName !== null;
60
    }
61
62
    /**
63
     * @return string|null
64
     */
65
    public function getAuthorName()
66
    {
67
        return $this->authorName;
68
    }
69
70
    /**
71
     * @param string|null $authorName
72
     */
73
    public function setAuthorName($authorName)
74
    {
75
        $this->authorName = $authorName;
76
    }
77
78
    /**
79
     * @return bool
80
     */
81
    public function hasAuthorUrl()
82
    {
83
        return $this->authorUrl !== null;
84
    }
85
86
    /**
87
     * @return string|null
88
     */
89
    public function getAuthorUrl()
90
    {
91
        return $this->authorUrl;
92
    }
93
94
    /**
95
     * @param string|null $authorUrl
96
     */
97
    public function setAuthorUrl($authorUrl)
98
    {
99
        $this->authorUrl = $authorUrl;
100
    }
101
102
    /**
103
     * @return bool
104
     */
105
    public function hasText()
106
    {
107
        return $this->text !== null;
108
    }
109
110
    /**
111
     * @return string|null
112
     */
113
    public function getText()
114
    {
115
        return $this->text;
116
    }
117
118
    /**
119
     * @param string|null $text
120
     */
121
    public function setText($text)
122
    {
123
        $this->text = $text;
124
    }
125
126
    /**
127
     * @return bool
128
     */
129
    public function hasRating()
130
    {
131
        return $this->rating !== null;
132
    }
133
134
    /**
135
     * @return float|null
136
     */
137
    public function getRating()
138
    {
139
        return $this->rating;
140
    }
141
142
    /**
143
     * @param float|null $rating
144
     */
145
    public function setRating($rating)
146
    {
147
        $this->rating = $rating;
148
    }
149
150
    /**
151
     * @return bool
152
     */
153
    public function hasTime()
154
    {
155
        return $this->time !== null;
156
    }
157
158
    /**
159
     * @return \DateTime|null
160
     */
161
    public function getTime()
162
    {
163
        return $this->time;
164
    }
165
166
    /**
167
     * @param \DateTime|null $time
168
     */
169
    public function setTime(\DateTime $time = null)
170
    {
171
        $this->time = $time;
172
    }
173
174
    /**
175
     * @return bool
176
     */
177
    public function hasLanguage()
178
    {
179
        return $this->language !== null;
180
    }
181
182
    /**
183
     * @return string|null
184
     */
185
    public function getLanguage()
186
    {
187
        return $this->language;
188
    }
189
190
    /**
191
     * @param string|null $language
192
     */
193
    public function setLanguage($language)
194
    {
195
        $this->language = $language;
196
    }
197
198
    /**
199
     * @return bool
200
     */
201
    public function hasAspects()
202
    {
203
        return !empty($this->aspects);
204
    }
205
206
    /**
207
     * @return AspectRating[]
208
     */
209
    public function getAspects()
210
    {
211
        return $this->aspects;
212
    }
213
214
    /**
215
     * @param AspectRating[] $aspects
216
     */
217
    public function setAspects(array $aspects)
218
    {
219
        $this->aspects = [];
220
        $this->addAspects($aspects);
221
    }
222
223
    /**
224
     * @param AspectRating[] $aspects
225
     */
226
    public function addAspects(array $aspects)
227
    {
228
        foreach ($aspects as $aspect) {
229
            $this->addAspect($aspect);
230
        }
231
    }
232
233
    /**
234
     * @param AspectRating $aspect
235
     *
236
     * @return bool
237
     */
238
    public function hasAspect(AspectRating $aspect)
239
    {
240
        return in_array($aspect, $this->aspects, true);
241
    }
242
243
    /**
244
     * @param AspectRating $aspect
245
     */
246
    public function addAspect(AspectRating $aspect)
247
    {
248
        if (!$this->hasAspect($aspect)) {
249
            $this->aspects[] = $aspect;
250
        }
251
    }
252
253
    /**
254
     * @param AspectRating $aspect
255
     */
256
    public function removeAspect(AspectRating $aspect)
257
    {
258
        unset($this->aspects[array_search($aspect, $this->aspects, true)]);
259
        $this->aspects = array_values($this->aspects);
260
    }
261
}
262