Completed
Push — feature/pilot_information ( 13ff1e...cc067b )
by Laurent
01:46
created

Pilot::__construct()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 63

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 30
dl 0
loc 63
rs 8.8072
c 0
b 0
f 0

How to fix   Long Method    Many Parameters   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
3
4
namespace FlightLog\Domain\Pilot;
5
6
7
use FlightLog\Domain\Pilot\ValueObject\EndDate;
8
use FlightLog\Domain\Pilot\ValueObject\FireCertificationNumber;
9
use FlightLog\Domain\Pilot\ValueObject\FirstHelpCertificationNumber;
10
use FlightLog\Domain\Pilot\ValueObject\IsOwner;
11
use FlightLog\Domain\Pilot\ValueObject\LastTrainingDate;
12
use FlightLog\Domain\Pilot\ValueObject\PilotId;
13
use FlightLog\Domain\Pilot\ValueObject\PilotLicenceNumber;
14
use FlightLog\Domain\Pilot\ValueObject\PilotTrainingLicenceNumber;
15
use FlightLog\Domain\Pilot\ValueObject\RadioLicenceDate;
16
use FlightLog\Domain\Pilot\ValueObject\RadioLicenceNumber;
17
use FlightLog\Domain\Pilot\ValueObject\StartDate;
18
19
final class Pilot
20
{
21
22
    /**
23
     * @var PilotId
24
     */
25
    private $pilotId;
26
    /**
27
     * @var PilotLicenceNumber
28
     */
29
    private $pilotLicenceNumber;
30
    /**
31
     * @var PilotTrainingLicenceNumber
32
     */
33
    private $trainingPilotLicenceNumber;
34
    /**
35
     * @var LastTrainingDate
36
     */
37
    private $lastTrainingFlightDate;
38
    /**
39
     * @var IsOwner
40
     */
41
    private $isPilotClassA;
42
    /**
43
     * @var IsOwner
44
     */
45
    private $isPilotClassB;
46
    /**
47
     * @var IsOwner
48
     */
49
    private $isPilotClassC;
50
    /**
51
     * @var IsOwner
52
     */
53
    private $isPilotClassD;
54
    /**
55
     * @var IsOwner
56
     */
57
    private $isPilotCaz;
58
    /**
59
     * @var IsOwner
60
     */
61
    private $isMedicalOwner;
62
    /**
63
     * @var EndDate
64
     */
65
    private $endMedicalDate;
66
67
    /**
68
     * @var StartDate
69
     */
70
    private $startMedicalDate;
71
    /**
72
     * @var IsOwner
73
     */
74
    private $hasQualifStatic;
75
    /**
76
     * @var IsOwner
77
     */
78
    private $hasQualifNight;
79
    /**
80
     * @var IsOwner
81
     */
82
    private $hasQualifPro;
83
    /**
84
     * @var LastTrainingDate
85
     */
86
    private $lastOpcDate;
87
    /**
88
     * @var LastTrainingDate
89
     */
90
    private $lastProRefreshDate;
91
    /**
92
     * @var IsOwner
93
     */
94
    private $hasQualifInstructor;
95
    /**
96
     * @var LastTrainingDate
97
     */
98
    private $lastInstructorRefreshDate;
99
    /**
100
     * @var IsOwner
101
     */
102
    private $hasQualifExaminator;
103
    /**
104
     * @var LastTrainingDate
105
     */
106
    private $lastExaminatorRefreshDate;
107
    /**
108
     * @var IsOwner
109
     */
110
    private $hasRadio;
111
    /**
112
     * @var RadioLicenceNumber
113
     */
114
    private $radioLicenceNumber;
115
    /**
116
     * @var RadioLicenceDate
117
     */
118
    private $radioLicenceDate;
119
    /**
120
     * @var IsOwner
121
     */
122
    private $hasTrainingFirstHelp;
123
    /**
124
     * @var LastTrainingDate
125
     */
126
    private $lastTrainingFirstHelpDate;
127
    /**
128
     * @var FirstHelpCertificationNumber
129
     */
130
    private $certificationNumberTrainingFirstHelp;
131
    /**
132
     * @var IsOwner
133
     */
134
    private $hasTrainingFire;
135
    /**
136
     * @var LastTrainingDate
137
     */
138
    private $lastTrainingFireDate;
139
    /**
140
     * @var FireCertificationNumber
141
     */
142
    private $certificationNumberTrainingFire;
143
144
    private function __construct(
145
        PilotId $pilotId,
146
        PilotLicenceNumber $pilotLicenceNumber,
147
        PilotTrainingLicenceNumber $trainingPilotLicenceNumber,
148
        LastTrainingDate $lastTrainingFlightDate,
149
        IsOwner $isPilotClassA,
150
        IsOwner $isPilotClassB,
151
        IsOwner $isPilotClassC,
152
        IsOwner $isPilotClassD,
153
        IsOwner $isPilotCaz,
154
        IsOwner $isMedicalOwner,
155
        EndDate $endMedicalDate,
156
        StartDate $startMedicalDate,
157
        IsOwner $hasQualifStatic,
158
        IsOwner $hasQualifNight,
159
        IsOwner $hasQualifPro,
160
        LastTrainingDate $lastOpcDate,
161
        LastTrainingDate $lastProRefreshDate,
162
        IsOwner $hasQualifInstructor,
163
        LastTrainingDate $lastInstructorRefreshDate,
164
        IsOwner $hasQualifExaminator,
165
        LastTrainingDate $lastExaminatorRefreshDate,
166
        IsOwner $hasRadio,
167
        RadioLicenceNumber $radioLicenceNumber,
168
        RadioLicenceDate $radioLicenceDate,
169
        IsOwner $hasTrainingFirstHelp,
170
        LastTrainingDate $lastTrainingFirstHelpDate,
171
        FirstHelpCertificationNumber $certificationNumberTrainingFirstHelp,
172
        IsOwner $hasTrainingFire,
173
        LastTrainingDate $lastTrainingFireDate,
174
        FireCertificationNumber $certificationNumberTrainingFire
175
    ) {
176
        $this->pilotId = $pilotId;
177
        $this->pilotLicenceNumber = $pilotLicenceNumber;
178
        $this->trainingPilotLicenceNumber = $trainingPilotLicenceNumber;
179
        $this->lastTrainingFlightDate = $lastTrainingFlightDate;
180
        $this->isPilotClassA = $isPilotClassA;
181
        $this->isPilotClassB = $isPilotClassB;
182
        $this->isPilotClassC = $isPilotClassC;
183
        $this->isPilotClassD = $isPilotClassD;
184
        $this->isPilotCaz = $isPilotCaz;
185
        $this->isMedicalOwner = $isMedicalOwner;
186
        $this->endMedicalDate = $endMedicalDate;
187
        $this->startMedicalDate = $startMedicalDate;
188
        $this->hasQualifStatic = $hasQualifStatic;
189
        $this->hasQualifNight = $hasQualifNight;
190
        $this->hasQualifPro = $hasQualifPro;
191
        $this->lastOpcDate = $lastOpcDate;
192
        $this->lastProRefreshDate = $lastProRefreshDate;
193
        $this->hasQualifInstructor = $hasQualifInstructor;
194
        $this->lastInstructorRefreshDate = $lastInstructorRefreshDate;
195
        $this->hasQualifExaminator = $hasQualifExaminator;
196
        $this->lastExaminatorRefreshDate = $lastExaminatorRefreshDate;
197
        $this->hasRadio = $hasRadio;
198
        $this->radioLicenceNumber = $radioLicenceNumber;
199
        $this->radioLicenceDate = $radioLicenceDate;
200
        $this->hasTrainingFirstHelp = $hasTrainingFirstHelp;
201
        $this->lastTrainingFirstHelpDate = $lastTrainingFirstHelpDate;
202
        $this->certificationNumberTrainingFirstHelp = $certificationNumberTrainingFirstHelp;
203
        $this->hasTrainingFire = $hasTrainingFire;
204
        $this->lastTrainingFireDate = $lastTrainingFireDate;
205
        $this->certificationNumberTrainingFire = $certificationNumberTrainingFire;
206
    }
207
208
    public static function create(PilotId $id)
209
    {
210
        return new self(
211
            $id,
212
            PilotLicenceNumber::empty(),
213
            PilotTrainingLicenceNumber::empty(),
214
            LastTrainingDate::zero(),
215
            IsOwner::create(),
216
            IsOwner::create(),
217
            IsOwner::create(),
218
            IsOwner::create(),
219
            IsOwner::create(),
220
            IsOwner::create(),
221
            EndDate::zero(),
222
            StartDate::zero(),
223
            IsOwner::create(),
224
            IsOwner::create(),
225
            IsOwner::create(),
226
            LastTrainingDate::zero(),
227
            LastTrainingDate::zero(),
228
            IsOwner::create(),
229
            LastTrainingDate::zero(),
230
            IsOwner::create(),
231
            LastTrainingDate::zero(),
232
            IsOwner::create(),
233
            RadioLicenceNumber::empty(),
234
            RadioLicenceDate::zero(),
235
            IsOwner::create(),
236
            LastTrainingDate::zero(),
237
            FirstHelpCertificationNumber::empty(),
238
            IsOwner::create(),
239
            LastTrainingDate::zero(),
240
            FireCertificationNumber::empty()
241
        );
242
    }
243
244
    public static function fromState(array $state): self
245
    {
246
        return new self(
247
            PilotId::create($state['user_id']),
248
            PilotLicenceNumber::create($state['pilot_licence_number']),
249
            PilotTrainingLicenceNumber::create($state['training_pilot_licence_number']),
250
            LastTrainingDate::fromString($state['last_training_flight_date']),
251
            IsOwner::fromValue($state['is_pilot_class_a']),
252
            IsOwner::fromValue($state['is_pilot_class_b']),
253
            IsOwner::fromValue($state['is_pilot_class_c']),
254
            IsOwner::fromValue($state['is_pilot_class_d']),
255
            IsOwner::fromValue($state['is_pilot_gaz']),
256
            IsOwner::fromValue($state['is_medical_owner']),
257
            EndDate::fromString($state['end_medical_date']),
258
            StartDate::fromString($state['start_medical_date']),
259
            IsOwner::fromValue($state['has_qualif_static']),
260
            IsOwner::fromValue($state['has_qualif_night']),
261
            IsOwner::fromValue($state['has_qualif_pro']),
262
            LastTrainingDate::fromString($state['last_opc_date']),
263
            LastTrainingDate::fromString($state['last_pro_refresh_date']),
264
            IsOwner::fromValue($state['has_qualif_instructor']),
265
            LastTrainingDate::fromString($state['last_instructor_refresh_date']),
266
            IsOwner::fromValue($state['has_qualif_examinator']),
267
            LastTrainingDate::fromString($state['last_examinator_refresh_date']),
268
            IsOwner::fromValue($state['has_radio']),
269
            RadioLicenceNumber::create($state['radio_licence_number']),
270
            RadioLicenceDate::fromString($state['radio_licence_date']),
271
            IsOwner::fromValue($state['has_training_first_help']),
272
            LastTrainingDate::fromString($state['last_training_first_help_date']),
273
            FirstHelpCertificationNumber::create($state['certification_number_training_first_help']),
274
            IsOwner::fromValue($state['has_training_fire']),
275
            LastTrainingDate::fromString($state['last_training_fire_date']),
276
            FireCertificationNumber::create($state['certification_number_training_fire'])
277
        );
278
    }
279
280
    public function state(): array
281
    {
282
        return [
283
            'user_id' => $this->pilotId->getId(),
284
            'pilot_licence_number' => $this->pilotLicenceNumber->getLicence(),
285
            'training_pilot_licence_number' => $this->trainingPilotLicenceNumber->getLicence(),
286
            'last_training_flight_date' => $this->lastTrainingFlightDate->asString(),
287
            'is_pilot_class_a' => $this->isPilotClassA->is(),
288
            'is_pilot_class_b' => $this->isPilotClassB->is(),
289
            'is_pilot_class_c' => $this->isPilotClassC->is(),
290
            'is_pilot_class_d' => $this->isPilotClassD->is(),
291
            'is_pilot_gaz' => $this->isPilotCaz->is(),
292
            'is_medical_owner' => $this->isMedicalOwner->is(),
293
            'end_medical_date' => $this->endMedicalDate->asString(),
294
            'start_medical_date' => $this->startMedicalDate->asString(),
295
            'medical_validity_duration' => 0,
296
            'has_qualif_static' => $this->hasQualifStatic->is(),
297
            'has_qualif_night' => $this->hasQualifNight->is(),
298
            'has_qualif_pro' => $this->hasQualifPro->is(),
299
            'last_opc_date' => $this->lastOpcDate->asString(),
300
            'last_pro_refresh_date' => $this->lastProRefreshDate->asString(),
301
            'has_qualif_instructor' => $this->hasQualifInstructor->is(),
302
            'last_instructor_refresh_date' => $this->lastInstructorRefreshDate->asString(),
303
            'has_qualif_examinator' => $this->hasQualifExaminator->is(),
304
            'last_examinator_refresh_date' => $this->lastExaminatorRefreshDate->asString(),
305
            'has_radio' => $this->hasRadio->is(),
306
            'radio_licence_number' => $this->radioLicenceNumber->getLicence(),
307
            'radio_licence_date' => $this->radioLicenceDate->asString(),
308
            'has_training_first_help' => $this->hasTrainingFirstHelp->is(),
309
            'last_training_first_help_date' => $this->lastTrainingFirstHelpDate->asString(),
310
            'certification_number_training_first_help' => $this->certificationNumberTrainingFirstHelp->getLicence(),
311
            'has_training_fire' => $this->hasTrainingFire->is(),
312
            'last_training_fire_date' => $this->lastTrainingFireDate->asString(),
313
            'certification_number_training_fire' => $this->certificationNumberTrainingFire->getLicence(),
314
        ];
315
    }
316
317
    public function id(): PilotId
318
    {
319
        return $this->pilotId;
320
    }
321
322
    public function medical()
323
    {
324
        $this->isMedicalOwner = IsOwner::yes();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::yes() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $isMedicalOwner.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
325
    }
326
327
    public function removeMedical()
328
    {
329
        $this->isMedicalOwner = IsOwner::no();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::no() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $isMedicalOwner.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
330
    }
331
332
    public function hasClassA()
333
    {
334
        $this->isPilotClassA = IsOwner::yes();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::yes() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $isPilotClassA.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
335
    }
336
337
    public function removeClassA()
338
    {
339
        $this->isPilotClassA = IsOwner::no();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::no() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $isPilotClassA.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
340
    }
341
342
    public function hasClassB()
343
    {
344
        $this->isPilotClassB = IsOwner::yes();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::yes() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $isPilotClassB.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
345
    }
346
347
    public function removeClassB()
348
    {
349
        $this->isPilotClassB = IsOwner::no();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::no() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $isPilotClassB.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
350
    }
351
352
    public function hasClassC()
353
    {
354
        $this->isPilotClassC = IsOwner::yes();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::yes() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $isPilotClassC.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
355
    }
356
357
    public function removeClassC()
358
    {
359
        $this->isPilotClassC = IsOwner::no();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::no() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $isPilotClassC.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
360
    }
361
362
    public function hasClassD()
363
    {
364
        $this->isPilotClassD = IsOwner::yes();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::yes() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $isPilotClassD.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
365
    }
366
367
    public function removeClassD()
368
    {
369
        $this->isPilotClassD = IsOwner::no();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::no() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $isPilotClassD.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
370
    }
371
372
    public function gazPilot()
373
    {
374
        $this->isPilotCaz = IsOwner::yes();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::yes() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $isPilotCaz.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
375
    }
376
377
    public function removeGazPilot()
378
    {
379
        $this->isPilotCaz = IsOwner::no();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::no() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $isPilotCaz.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
380
    }
381
382
    public function staticQualif()
383
    {
384
        $this->hasQualifStatic = IsOwner::yes();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::yes() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $hasQualifStatic.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
385
    }
386
387
    public function removeStaticQualif()
388
    {
389
        $this->hasQualifStatic = IsOwner::no();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::no() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $hasQualifStatic.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
390
    }
391
392
    public function nightQualif()
393
    {
394
        $this->hasQualifNight = IsOwner::yes();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::yes() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $hasQualifNight.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
395
    }
396
397
    public function removeNightQualif()
398
    {
399
        $this->hasQualifNight = IsOwner::no();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::no() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $hasQualifNight.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
400
    }
401
402
    public function proQualif()
403
    {
404
        $this->hasQualifPro = IsOwner::yes();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::yes() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $hasQualifPro.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
405
    }
406
407
    public function removeProQualif()
408
    {
409
        $this->hasQualifPro = IsOwner::no();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::no() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $hasQualifPro.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
410
    }
411
412
    public function instructorQualif()
413
    {
414
        $this->hasQualifInstructor = IsOwner::yes();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::yes() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $hasQualifInstructor.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
415
    }
416
417
    public function removeInstructorQualif()
418
    {
419
        $this->hasQualifInstructor = IsOwner::no();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::no() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $hasQualifInstructor.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
420
    }
421
422
    public function examinatorQualif()
423
    {
424
        $this->hasQualifExaminator = IsOwner::yes();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::yes() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $hasQualifExaminator.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
425
    }
426
427
    public function removeExaminatorQualif()
428
    {
429
        $this->hasQualifExaminator = IsOwner::no();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::no() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $hasQualifExaminator.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
430
    }
431
432
    public function radio()
433
    {
434
        $this->hasRadio = IsOwner::yes();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::yes() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $hasRadio.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
435
    }
436
437
    public function removeRadio()
438
    {
439
        $this->hasRadio = IsOwner::no();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::no() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $hasRadio.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
440
    }
441
442
    public function trainingFirstHelp()
443
    {
444
        $this->hasTrainingFirstHelp = IsOwner::yes();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::yes() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $hasTrainingFirstHelp.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
445
    }
446
447
    public function removeTrainingFirstHelp()
448
    {
449
        $this->hasTrainingFirstHelp = IsOwner::no();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::no() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $hasTrainingFirstHelp.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
450
    }
451
452
    public function trainingFire()
453
    {
454
        $this->hasTrainingFire = IsOwner::yes();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::yes() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $hasTrainingFire.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
455
    }
456
457
    public function removeTrainingFire()
458
    {
459
        $this->hasTrainingFire = IsOwner::no();
0 ignored issues
show
Documentation Bug introduced by
It seems like \FlightLog\Domain\Pilot\ValueObject\IsOwner::no() of type object<self> is incompatible with the declared type object<FlightLog\Domain\...ot\ValueObject\IsOwner> of property $hasTrainingFire.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
460
    }
461
462
    public function attributePilotLicenceNumber(PilotLicenceNumber $value)
463
    {
464
        $this->pilotLicenceNumber = $value;
465
    }
466
467
    public function attributeTrainingPilotLicenceNumber(PilotTrainingLicenceNumber $value)
468
    {
469
        $this->trainingPilotLicenceNumber = $value;
470
    }
471
472
    public function attributeRadioLicenceNumber(RadioLicenceNumber $value)
473
    {
474
        $this->radioLicenceNumber = $value;
475
    }
476
477
    public function attributeCertificationNumberTrainingFirstHelp(FirstHelpCertificationNumber $value)
478
    {
479
        $this->certificationNumberTrainingFirstHelp = $value;
480
    }
481
482
    public function attributeCertificationNumberTrainingFire(FireCertificationNumber $value)
483
    {
484
        $this->certificationNumberTrainingFire = $value;
485
    }
486
487
    public function attributeLastTrainingFlightDate(LastTrainingDate $value)
488
    {
489
        $this->lastTrainingFlightDate = $value;
490
    }
491
492
    public function attributeEndMedicalDate(EndDate $value)
493
    {
494
        $this->endMedicalDate = $value;
495
    }
496
497
    public function attributeStartMedicalDate(StartDate $value)
498
    {
499
        $this->startMedicalDate = $value;
500
    }
501
502
    public function attributeLastOpcDate(LastTrainingDate $value)
503
    {
504
        $this->lastOpcDate = $value;
505
    }
506
507
    public function attributeLastProRefreshDate(LastTrainingDate $value)
508
    {
509
        $this->lastProRefreshDate = $value;
510
    }
511
512
    public function attributeLastInstructorRefreshDate(LastTrainingDate $value)
513
    {
514
        $this->lastInstructorRefreshDate = $value;
515
    }
516
517
    public function attributeLastExaminatorRefreshDate(LastTrainingDate $value)
518
    {
519
        $this->lastExaminatorRefreshDate = $value;
520
    }
521
522
    public function attributeLastTrainingFireDate(LastTrainingDate $value)
523
    {
524
        $this->lastTrainingFireDate = $value;
525
    }
526
527
    public function attributeRadioLicenceDate(RadioLicenceDate $value)
528
    {
529
        $this->radioLicenceDate =  $value;
530
    }
531
532
    public function attributeLastTrainingFirstHelpDate(LastTrainingDate $value)
533
    {
534
        $this->lastTrainingFirstHelpDate = $value;
535
    }
536
}