RequiredDeposit::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 23
ccs 0
cts 23
cp 0
rs 9.0856
c 0
b 0
f 0
cc 1
eloc 21
nc 1
nop 20
crap 2

How to fix   Many Parameters   

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
namespace Gueststream\PMS\IQWare\API;
4
5
class RequiredDeposit
6
{
7
8
    /**
9
     * @var \DateTime $ADate1
10
     */
11
    protected $ADate1 = null;
12
13
    /**
14
     * @var int $DateType1
15
     */
16
    protected $DateType1 = null;
17
18
    /**
19
     * @var float $LevelAmount1
20
     */
21
    protected $LevelAmount1 = null;
22
23
    /**
24
     * @var int $StatusLevel1
25
     */
26
    protected $StatusLevel1 = null;
27
28
    /**
29
     * @var int $NbDaysDeposit1
30
     */
31
    protected $NbDaysDeposit1 = null;
32
33
    /**
34
     * @var int $DepositType1
35
     */
36
    protected $DepositType1 = null;
37
38
    /**
39
     * @var \DateTime $ADate2
40
     */
41
    protected $ADate2 = null;
42
43
    /**
44
     * @var int $DateType2
45
     */
46
    protected $DateType2 = null;
47
48
    /**
49
     * @var float $LevelAmount2
50
     */
51
    protected $LevelAmount2 = null;
52
53
    /**
54
     * @var int $StatusLevel2
55
     */
56
    protected $StatusLevel2 = null;
57
58
    /**
59
     * @var int $NbDaysDeposit2
60
     */
61
    protected $NbDaysDeposit2 = null;
62
63
    /**
64
     * @var int $DepositType2
65
     */
66
    protected $DepositType2 = null;
67
68
    /**
69
     * @var \DateTime $ADate3
70
     */
71
    protected $ADate3 = null;
72
73
    /**
74
     * @var int $DateType3
75
     */
76
    protected $DateType3 = null;
77
78
    /**
79
     * @var float $LevelAmount3
80
     */
81
    protected $LevelAmount3 = null;
82
83
    /**
84
     * @var int $StatusLevel3
85
     */
86
    protected $StatusLevel3 = null;
87
88
    /**
89
     * @var int $NbDaysDeposit3
90
     */
91
    protected $NbDaysDeposit3 = null;
92
93
    /**
94
     * @var int $DepositType3
95
     */
96
    protected $DepositType3 = null;
97
98
    /**
99
     * @var string $CancelPolitics
100
     */
101
    protected $CancelPolitics = null;
102
103
    /**
104
     * @var string $SeasonName
105
     */
106
    protected $SeasonName = null;
107
108
    /**
109
     * @var float $TotStayBDGlobal
110
     */
111
    protected $TotStayBDGlobal = null;
112
113
    /**
114
     * @var float $TotStayBD1Global
115
     */
116
    protected $TotStayBD1Global = null;
117
118
    /**
119
     * @param \DateTime $ADate1
120
     * @param int $DateType1
121
     * @param float $LevelAmount1
122
     * @param int $StatusLevel1
123
     * @param int $NbDaysDeposit1
124
     * @param int $DepositType1
125
     * @param \DateTime $ADate2
126
     * @param int $DateType2
127
     * @param float $LevelAmount2
128
     * @param int $StatusLevel2
129
     * @param int $NbDaysDeposit2
130
     * @param int $DepositType2
131
     * @param \DateTime $ADate3
132
     * @param int $DateType3
133
     * @param float $LevelAmount3
134
     * @param int $StatusLevel3
135
     * @param int $NbDaysDeposit3
136
     * @param int $DepositType3
137
     * @param float $TotStayBDGlobal
138
     * @param float $TotStayBD1Global
139
     */
140
    public function __construct(\DateTime $ADate1, $DateType1, $LevelAmount1, $StatusLevel1, $NbDaysDeposit1, $DepositType1, \DateTime $ADate2, $DateType2, $LevelAmount2, $StatusLevel2, $NbDaysDeposit2, $DepositType2, \DateTime $ADate3, $DateType3, $LevelAmount3, $StatusLevel3, $NbDaysDeposit3, $DepositType3, $TotStayBDGlobal, $TotStayBD1Global)
141
    {
142
        $this->ADate1 = $ADate1->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $ADate1->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $ADate1.

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...
143
        $this->DateType1 = $DateType1;
144
        $this->LevelAmount1 = $LevelAmount1;
145
        $this->StatusLevel1 = $StatusLevel1;
146
        $this->NbDaysDeposit1 = $NbDaysDeposit1;
147
        $this->DepositType1 = $DepositType1;
148
        $this->ADate2 = $ADate2->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $ADate2->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $ADate2.

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...
149
        $this->DateType2 = $DateType2;
150
        $this->LevelAmount2 = $LevelAmount2;
151
        $this->StatusLevel2 = $StatusLevel2;
152
        $this->NbDaysDeposit2 = $NbDaysDeposit2;
153
        $this->DepositType2 = $DepositType2;
154
        $this->ADate3 = $ADate3->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $ADate3->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $ADate3.

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...
155
        $this->DateType3 = $DateType3;
156
        $this->LevelAmount3 = $LevelAmount3;
157
        $this->StatusLevel3 = $StatusLevel3;
158
        $this->NbDaysDeposit3 = $NbDaysDeposit3;
159
        $this->DepositType3 = $DepositType3;
160
        $this->TotStayBDGlobal = $TotStayBDGlobal;
161
        $this->TotStayBD1Global = $TotStayBD1Global;
162
    }
163
164
    /**
165
     * @return \DateTime
166
     */
167
    public function getADate1()
168
    {
169
        if ($this->ADate1 == null) {
170
            return null;
171
        } else {
172
            try {
173
                return new \DateTime($this->ADate1);
174
            } catch (\Exception $e) {
175
                return false;
176
            }
177
        }
178
    }
179
180
    /**
181
     * @param \DateTime $ADate1
182
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
183
     */
184
    public function setADate1(\DateTime $ADate1)
185
    {
186
        $this->ADate1 = $ADate1->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $ADate1->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $ADate1.

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...
187
        return $this;
188
    }
189
190
    /**
191
     * @return int
192
     */
193
    public function getDateType1()
194
    {
195
        return $this->DateType1;
196
    }
197
198
    /**
199
     * @param int $DateType1
200
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
201
     */
202
    public function setDateType1($DateType1)
203
    {
204
        $this->DateType1 = $DateType1;
205
        return $this;
206
    }
207
208
    /**
209
     * @return float
210
     */
211
    public function getLevelAmount1()
212
    {
213
        return $this->LevelAmount1;
214
    }
215
216
    /**
217
     * @param float $LevelAmount1
218
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
219
     */
220
    public function setLevelAmount1($LevelAmount1)
221
    {
222
        $this->LevelAmount1 = $LevelAmount1;
223
        return $this;
224
    }
225
226
    /**
227
     * @return int
228
     */
229
    public function getStatusLevel1()
230
    {
231
        return $this->StatusLevel1;
232
    }
233
234
    /**
235
     * @param int $StatusLevel1
236
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
237
     */
238
    public function setStatusLevel1($StatusLevel1)
239
    {
240
        $this->StatusLevel1 = $StatusLevel1;
241
        return $this;
242
    }
243
244
    /**
245
     * @return int
246
     */
247
    public function getNbDaysDeposit1()
248
    {
249
        return $this->NbDaysDeposit1;
250
    }
251
252
    /**
253
     * @param int $NbDaysDeposit1
254
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
255
     */
256
    public function setNbDaysDeposit1($NbDaysDeposit1)
257
    {
258
        $this->NbDaysDeposit1 = $NbDaysDeposit1;
259
        return $this;
260
    }
261
262
    /**
263
     * @return int
264
     */
265
    public function getDepositType1()
266
    {
267
        return $this->DepositType1;
268
    }
269
270
    /**
271
     * @param int $DepositType1
272
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
273
     */
274
    public function setDepositType1($DepositType1)
275
    {
276
        $this->DepositType1 = $DepositType1;
277
        return $this;
278
    }
279
280
    /**
281
     * @return \DateTime
282
     */
283
    public function getADate2()
284
    {
285
        if ($this->ADate2 == null) {
286
            return null;
287
        } else {
288
            try {
289
                return new \DateTime($this->ADate2);
290
            } catch (\Exception $e) {
291
                return false;
292
            }
293
        }
294
    }
295
296
    /**
297
     * @param \DateTime $ADate2
298
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
299
     */
300
    public function setADate2(\DateTime $ADate2)
301
    {
302
        $this->ADate2 = $ADate2->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $ADate2->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $ADate2.

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...
303
        return $this;
304
    }
305
306
    /**
307
     * @return int
308
     */
309
    public function getDateType2()
310
    {
311
        return $this->DateType2;
312
    }
313
314
    /**
315
     * @param int $DateType2
316
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
317
     */
318
    public function setDateType2($DateType2)
319
    {
320
        $this->DateType2 = $DateType2;
321
        return $this;
322
    }
323
324
    /**
325
     * @return float
326
     */
327
    public function getLevelAmount2()
328
    {
329
        return $this->LevelAmount2;
330
    }
331
332
    /**
333
     * @param float $LevelAmount2
334
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
335
     */
336
    public function setLevelAmount2($LevelAmount2)
337
    {
338
        $this->LevelAmount2 = $LevelAmount2;
339
        return $this;
340
    }
341
342
    /**
343
     * @return int
344
     */
345
    public function getStatusLevel2()
346
    {
347
        return $this->StatusLevel2;
348
    }
349
350
    /**
351
     * @param int $StatusLevel2
352
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
353
     */
354
    public function setStatusLevel2($StatusLevel2)
355
    {
356
        $this->StatusLevel2 = $StatusLevel2;
357
        return $this;
358
    }
359
360
    /**
361
     * @return int
362
     */
363
    public function getNbDaysDeposit2()
364
    {
365
        return $this->NbDaysDeposit2;
366
    }
367
368
    /**
369
     * @param int $NbDaysDeposit2
370
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
371
     */
372
    public function setNbDaysDeposit2($NbDaysDeposit2)
373
    {
374
        $this->NbDaysDeposit2 = $NbDaysDeposit2;
375
        return $this;
376
    }
377
378
    /**
379
     * @return int
380
     */
381
    public function getDepositType2()
382
    {
383
        return $this->DepositType2;
384
    }
385
386
    /**
387
     * @param int $DepositType2
388
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
389
     */
390
    public function setDepositType2($DepositType2)
391
    {
392
        $this->DepositType2 = $DepositType2;
393
        return $this;
394
    }
395
396
    /**
397
     * @return \DateTime
398
     */
399
    public function getADate3()
400
    {
401
        if ($this->ADate3 == null) {
402
            return null;
403
        } else {
404
            try {
405
                return new \DateTime($this->ADate3);
406
            } catch (\Exception $e) {
407
                return false;
408
            }
409
        }
410
    }
411
412
    /**
413
     * @param \DateTime $ADate3
414
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
415
     */
416
    public function setADate3(\DateTime $ADate3)
417
    {
418
        $this->ADate3 = $ADate3->format(\DateTime::ATOM);
0 ignored issues
show
Documentation Bug introduced by
It seems like $ADate3->format(\DateTime::ATOM) of type string is incompatible with the declared type object<DateTime> of property $ADate3.

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...
419
        return $this;
420
    }
421
422
    /**
423
     * @return int
424
     */
425
    public function getDateType3()
426
    {
427
        return $this->DateType3;
428
    }
429
430
    /**
431
     * @param int $DateType3
432
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
433
     */
434
    public function setDateType3($DateType3)
435
    {
436
        $this->DateType3 = $DateType3;
437
        return $this;
438
    }
439
440
    /**
441
     * @return float
442
     */
443
    public function getLevelAmount3()
444
    {
445
        return $this->LevelAmount3;
446
    }
447
448
    /**
449
     * @param float $LevelAmount3
450
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
451
     */
452
    public function setLevelAmount3($LevelAmount3)
453
    {
454
        $this->LevelAmount3 = $LevelAmount3;
455
        return $this;
456
    }
457
458
    /**
459
     * @return int
460
     */
461
    public function getStatusLevel3()
462
    {
463
        return $this->StatusLevel3;
464
    }
465
466
    /**
467
     * @param int $StatusLevel3
468
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
469
     */
470
    public function setStatusLevel3($StatusLevel3)
471
    {
472
        $this->StatusLevel3 = $StatusLevel3;
473
        return $this;
474
    }
475
476
    /**
477
     * @return int
478
     */
479
    public function getNbDaysDeposit3()
480
    {
481
        return $this->NbDaysDeposit3;
482
    }
483
484
    /**
485
     * @param int $NbDaysDeposit3
486
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
487
     */
488
    public function setNbDaysDeposit3($NbDaysDeposit3)
489
    {
490
        $this->NbDaysDeposit3 = $NbDaysDeposit3;
491
        return $this;
492
    }
493
494
    /**
495
     * @return int
496
     */
497
    public function getDepositType3()
498
    {
499
        return $this->DepositType3;
500
    }
501
502
    /**
503
     * @param int $DepositType3
504
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
505
     */
506
    public function setDepositType3($DepositType3)
507
    {
508
        $this->DepositType3 = $DepositType3;
509
        return $this;
510
    }
511
512
    /**
513
     * @return string
514
     */
515
    public function getCancelPolitics()
516
    {
517
        return $this->CancelPolitics;
518
    }
519
520
    /**
521
     * @param string $CancelPolitics
522
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
523
     */
524
    public function setCancelPolitics($CancelPolitics)
525
    {
526
        $this->CancelPolitics = $CancelPolitics;
527
        return $this;
528
    }
529
530
    /**
531
     * @return string
532
     */
533
    public function getSeasonName()
534
    {
535
        return $this->SeasonName;
536
    }
537
538
    /**
539
     * @param string $SeasonName
540
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
541
     */
542
    public function setSeasonName($SeasonName)
543
    {
544
        $this->SeasonName = $SeasonName;
545
        return $this;
546
    }
547
548
    /**
549
     * @return float
550
     */
551
    public function getTotStayBDGlobal()
552
    {
553
        return $this->TotStayBDGlobal;
554
    }
555
556
    /**
557
     * @param float $TotStayBDGlobal
558
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
559
     */
560
    public function setTotStayBDGlobal($TotStayBDGlobal)
561
    {
562
        $this->TotStayBDGlobal = $TotStayBDGlobal;
563
        return $this;
564
    }
565
566
    /**
567
     * @return float
568
     */
569
    public function getTotStayBD1Global()
570
    {
571
        return $this->TotStayBD1Global;
572
    }
573
574
    /**
575
     * @param float $TotStayBD1Global
576
     * @return \Gueststream\PMS\IQWare\API\RequiredDeposit
577
     */
578
    public function setTotStayBD1Global($TotStayBD1Global)
579
    {
580
        $this->TotStayBD1Global = $TotStayBD1Global;
581
        return $this;
582
    }
583
}
584