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
Branch user-entity (5d2483)
by Luis Ramón
03:29
created

Person::setTokenValidity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/*
3
  ÁTICA - Aplicación web para la gestión documental de centros educativos
4
5
  Copyright (C) 2015-2016: Luis Ramón López López
6
7
  This program is free software: you can redistribute it and/or modify
8
  it under the terms of the GNU Affero General Public License as published by
9
  the Free Software Foundation, either version 3 of the License, or
10
  (at your option) any later version.
11
12
  This program is distributed in the hope that it will be useful,
13
  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
  GNU Affero General Public License for more details.
16
17
  You should have received a copy of the GNU Affero General Public License
18
  along with this program.  If not, see [http://www.gnu.org/licenses/].
19
*/
20
21
namespace AppBundle\Entity;
22
23
use Doctrine\ORM\Mapping as ORM;
24
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
25
use Symfony\Component\Validator\Constraints as Assert;
26
27
/**
28
 * @ORM\MappedSuperclass
29
 * @UniqueEntity("email")
30
 */
31
class Person
32
{
33
    const GENDER_UNKNOWN = 0;
34
    const GENDER_MALE = 1;
35
    const GENDER_FEMALE = 2;
36
37
    /**
38
     * @ORM\Column(type="string", unique=true, nullable=true)
39
     * @var string
40
     */
41
    protected $reference;
42
43
    /**
44
     * @ORM\Column(type="string")
45
     * @Assert\NotBlank()
46
     * @var string
47
     */
48
    protected $firstName;
49
50
    /**
51
     * @ORM\Column(type="string")
52
     * @Assert\NotBlank()
53
     * @var string
54
     */
55
    protected $lastName;
56
57
    /**
58
     * @ORM\Column(type="integer")
59
     * @var int
60
     */
61
    protected $gender;
62
63
    /**
64
     * @ORM\Column(type="string", nullable=true)
65
     * @var string
66
     */
67
    protected $displayName;
68
69
    /**
70
     * @ORM\Column(type="string", nullable=true)
71
     * @var string
72
     */
73
    protected $initials;
74
75
    /**
76
     * @ORM\Column(type="string", nullable=true)
77
     * @var string
78
     */
79
    protected $address;
80
81
    /**
82
     * @ORM\Column(type="string", nullable=true)
83
     * @var string
84
     */
85
    protected $city;
86
87
    /**
88
     * @ORM\Column(type="string", nullable=true)
89
     * @var string
90
     */
91
    protected $province;
92
93
    /**
94
     * @ORM\Column(type="string", nullable=true)
95
     * @var string
96
     */
97
    protected $zipCode;
98
99
    /**
100
     * @ORM\Column(type="string", nullable=true)
101
     * @var string
102
     */
103
    protected $phoneNumber;
104
105
    /**
106
     * @ORM\Column(type="string", unique=true, nullable=true)
107
     * @Assert\Email()
108
     * @var string
109
     */
110
    protected $email;
111
112
    public function __construct()
113
    {
114
        $this->gender = self::GENDER_UNKNOWN;
115
    }
116
117
    /**
118
     * Returns the person's display name
119
     *
120
     * @return string
121
     */
122
    public function __toString()
123
    {
124
        $displayName = $this->getDisplayName() ?: $this->getFirstName() . ' ' . $this->getLastName();
125
        
126
        return $this->getLastName() ? $displayName : '';
127
    }
128
129
    /**
130
     * Set reference
131
     *
132
     * @param string $reference
133
     *
134
     * @return User
135
     */
136
    public function setReference($reference)
137
    {
138
        $this->reference = $reference;
139
140
        return $this;
141
    }
142
143
    /**
144
     * Get reference
145
     *
146
     * @return string
147
     */
148
    public function getReference()
149
    {
150
        return $this->reference;
151
    }
152
153
    /**
154
     * Set firstName
155
     *
156
     * @param string $firstName
157
     *
158
     * @return User
159
     */
160
    public function setFirstName($firstName)
161
    {
162
        $this->firstName = $firstName;
163
164
        return $this;
165
    }
166
167
    /**
168
     * Get firstName
169
     *
170
     * @return string
171
     */
172
    public function getFirstName()
173
    {
174
        return $this->firstName;
175
    }
176
177
    /**
178
     * Set lastName
179
     *
180
     * @param string $lastName
181
     *
182
     * @return User
183
     */
184
    public function setLastName($lastName)
185
    {
186
        $this->lastName = $lastName;
187
188
        return $this;
189
    }
190
191
    /**
192
     * Get lastName
193
     *
194
     * @return string
195
     */
196
    public function getLastName()
197
    {
198
        return $this->lastName;
199
    }
200
201
    /**
202
     * Set gender
203
     *
204
     * @param integer $gender
205
     *
206
     * @return User
207
     */
208
    public function setGender($gender)
209
    {
210
        $this->gender = $gender;
211
212
        return $this;
213
    }
214
215
    /**
216
     * Get gender
217
     *
218
     * @return integer
219
     */
220
    public function getGender()
221
    {
222
        return $this->gender;
223
    }
224
225
    /**
226
     * Set displayName
227
     *
228
     * @param string $displayName
229
     *
230
     * @return User
231
     */
232
    public function setDisplayName($displayName)
233
    {
234
        $this->displayName = $displayName;
235
236
        return $this;
237
    }
238
239
    /**
240
     * Get displayName
241
     *
242
     * @return string
243
     */
244
    public function getDisplayName()
245
    {
246
        return $this->displayName;
247
    }
248
249
    /**
250
     * Set initials
251
     *
252
     * @param string $initials
253
     *
254
     * @return User
255
     */
256
    public function setInitials($initials)
257
    {
258
        $this->initials = $initials;
259
260
        return $this;
261
    }
262
263
    /**
264
     * Get initials
265
     *
266
     * @return string
267
     */
268
    public function getInitials()
269
    {
270
        return $this->initials;
271
    }
272
273
    /**
274
     * Set address
275
     *
276
     * @param string $address
277
     *
278
     * @return User
279
     */
280
    public function setAddress($address)
281
    {
282
        $this->address = $address;
283
284
        return $this;
285
    }
286
287
    /**
288
     * Get address
289
     *
290
     * @return string
291
     */
292
    public function getAddress()
293
    {
294
        return $this->address;
295
    }
296
297
    /**
298
     * Set city
299
     *
300
     * @param string $city
301
     *
302
     * @return User
303
     */
304
    public function setCity($city)
305
    {
306
        $this->city = $city;
307
308
        return $this;
309
    }
310
311
    /**
312
     * Get city
313
     *
314
     * @return string
315
     */
316
    public function getCity()
317
    {
318
        return $this->city;
319
    }
320
321
    /**
322
     * Set province
323
     *
324
     * @param string $province
325
     *
326
     * @return User
327
     */
328
    public function setProvince($province)
329
    {
330
        $this->province = $province;
331
332
        return $this;
333
    }
334
335
    /**
336
     * Get province
337
     *
338
     * @return string
339
     */
340
    public function getProvince()
341
    {
342
        return $this->province;
343
    }
344
345
    /**
346
     * Set zipCode
347
     *
348
     * @param string $zipCode
349
     *
350
     * @return User
351
     */
352
    public function setZipCode($zipCode)
353
    {
354
        $this->zipCode = $zipCode;
355
356
        return $this;
357
    }
358
359
    /**
360
     * Get zipCode
361
     *
362
     * @return string
363
     */
364
    public function getZipCode()
365
    {
366
        return $this->zipCode;
367
    }
368
369
    /**
370
     * Set phoneNumber
371
     *
372
     * @param string $phoneNumber
373
     *
374
     * @return User
375
     */
376
    public function setPhoneNumber($phoneNumber)
377
    {
378
        $this->phoneNumber = $phoneNumber;
379
380
        return $this;
381
    }
382
383
    /**
384
     * Get phoneNumber
385
     *
386
     * @return string
387
     */
388
    public function getPhoneNumber()
389
    {
390
        return $this->phoneNumber;
391
    }
392
393
394
    /**
395
     * Get email
396
     *
397
     * @return string
398
     */
399
    public function getEmail()
400
    {
401
        return $this->email;
402
    }
403
404
    /**
405
     * Set email
406
     *
407
     * @param string $email
408
     *
409
     * @return User
410
     */
411
    public function setEmail($email)
412
    {
413
        $this->email = $email;
414
415
        return $this;
416
    }
417
}
418