Passed
Push — dev ( 0448bb...a2895b )
by Janko
09:12
created

ShipRumpModuleLevel::getModuleMandatory6()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Orm\Entity;
6
7
use Doctrine\ORM\Mapping\Column;
8
use Doctrine\ORM\Mapping\Entity;
9
use Doctrine\ORM\Mapping\GeneratedValue;
10
use Doctrine\ORM\Mapping\Id;
11
use Doctrine\ORM\Mapping\Index;
12
use Doctrine\ORM\Mapping\Table;
13
use Override;
0 ignored issues
show
Bug introduced by
The type Override was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
use Stu\Component\Spacecraft\SpacecraftModuleTypeEnum;
15
use Stu\Orm\Repository\ShipRumpModuleLevelRepository;
16
17
#[Table(name: 'stu_rumps_module_level')]
18
#[Index(name: 'rump_module_level_ship_rump_idx', columns: ['rump_id'])]
19
#[Entity(repositoryClass: ShipRumpModuleLevelRepository::class)]
20
class ShipRumpModuleLevel implements ShipRumpModuleLevelInterface
21
{
22
    #[Id]
23
    #[Column(type: 'integer')]
24
    #[GeneratedValue(strategy: 'IDENTITY')]
25
    private int $id;
26
27
    #[Column(type: 'integer')]
28
    private int $rump_id = 0;
29
30
    #[Column(type: 'smallint')]
31
    private int $module_level_1 = 0;
32
33
    #[Column(type: 'smallint')]
34
    private int $module_mandatory_1 = 0;
35
36
    #[Column(type: 'smallint')]
37
    private int $module_level_1_min = 0;
38
39
    #[Column(type: 'smallint')]
40
    private int $module_level_1_max = 0;
41
42
    #[Column(type: 'smallint')]
43
    private int $module_level_2 = 0;
44
45
    #[Column(type: 'smallint')]
46
    private int $module_mandatory_2 = 0;
47
48
    #[Column(type: 'smallint')]
49
    private int $module_level_2_min = 0;
50
51
    #[Column(type: 'smallint')]
52
    private int $module_level_2_max = 0;
53
54
    #[Column(type: 'smallint')]
55
    private int $module_level_3 = 0;
56
57
    #[Column(type: 'smallint')]
58
    private int $module_mandatory_3 = 0;
59
60
    #[Column(type: 'smallint')]
61
    private int $module_level_3_min = 0;
62
63
    #[Column(type: 'smallint')]
64
    private int $module_level_3_max = 0;
65
66
    #[Column(type: 'smallint')]
67
    private int $module_level_4 = 0;
68
69
    #[Column(type: 'smallint')]
70
    private int $module_mandatory_4 = 0;
71
72
    #[Column(type: 'smallint')]
73
    private int $module_level_4_min = 0;
74
75
    #[Column(type: 'smallint')]
76
    private int $module_level_4_max = 0;
77
78
    #[Column(type: 'smallint')]
79
    private int $module_level_5 = 0;
80
81
    #[Column(type: 'smallint')]
82
    private int $module_mandatory_5 = 0;
83
84
    #[Column(type: 'smallint')]
85
    private int $module_level_5_min = 0;
86
87
    #[Column(type: 'smallint')]
88
    private int $module_level_5_max = 0;
89
90
    #[Column(type: 'smallint')]
91
    private int $module_level_6 = 0;
92
93
    #[Column(type: 'smallint')]
94
    private int $module_mandatory_6 = 0;
95
96
    #[Column(type: 'smallint')]
97
    private int $module_level_6_min = 0;
98
99
    #[Column(type: 'smallint')]
100
    private int $module_level_6_max = 0;
101
102
    #[Column(type: 'smallint')]
103
    private int $module_level_7 = 0;
104
105
    #[Column(type: 'smallint')]
106
    private int $module_mandatory_7 = 0;
107
108
    #[Column(type: 'smallint')]
109
    private int $module_level_7_min = 0;
110
111
    #[Column(type: 'smallint')]
112
    private int $module_level_7_max = 0;
113
114
    #[Column(type: 'smallint')]
115
    private int $module_level_8 = 0;
116
117
    #[Column(type: 'smallint')]
118
    private int $module_mandatory_8 = 0;
119
120
    #[Column(type: 'smallint')]
121
    private int $module_level_8_min = 0;
122
123
    #[Column(type: 'smallint')]
124
    private int $module_level_8_max = 0;
125
126
    #[Column(type: 'smallint')]
127
    private int $module_level_10 = 0;
128
129
    #[Column(type: 'smallint')]
130
    private int $module_mandatory_10 = 0;
131
132
    #[Column(type: 'smallint')]
133
    private int $module_level_10_min = 0;
134
135
    #[Column(type: 'smallint')]
136
    private int $module_level_10_max = 0;
137
138
    #[Column(type: 'smallint')]
139
    private int $module_level_11 = 0;
140
141
    #[Column(type: 'smallint')]
142
    private int $module_mandatory_11 = 0;
143
144
    #[Column(type: 'smallint')]
145
    private int $module_level_11_min = 0;
146
147
    #[Column(type: 'smallint')]
148
    private int $module_level_11_max = 0;
149
150
    #[Override]
151
    public function getId(): int
152
    {
153
        return $this->id;
154
    }
155
156
    #[Override]
157
    public function getRumpId(): int
158
    {
159
        return $this->rump_id;
160
    }
161
162 3
    #[Override]
163
    public function getModuleLevel1(): int
164
    {
165 3
        return $this->module_level_1;
166
    }
167
168
    #[Override]
169
    public function setModuleLevel1(int $moduleLevel1): ShipRumpModuleLevelInterface
170
    {
171
        $this->module_level_1 = $moduleLevel1;
172
173
        return $this;
174
    }
175
176 3
    #[Override]
177
    public function getModuleMandatory1(): bool
178
    {
179 3
        return $this->module_mandatory_1 === self::MODULE_MANDATORY;
180
    }
181
182
    #[Override]
183
    public function setModuleMandatory1(int $moduleMandatory1): ShipRumpModuleLevelInterface
184
    {
185
        $this->module_mandatory_1 = $moduleMandatory1;
186
187
        return $this;
188
    }
189
190 4
    #[Override]
191
    public function getModuleLevel1Min(): int
192
    {
193 4
        return $this->module_level_1_min;
194
    }
195
196
    #[Override]
197
    public function setModuleLevel1Min(int $moduleLevel1Min): ShipRumpModuleLevelInterface
198
    {
199
        $this->module_level_1_min = $moduleLevel1Min;
200
201
        return $this;
202
    }
203
204 4
    #[Override]
205
    public function getModuleLevel1Max(): int
206
    {
207 4
        return $this->module_level_1_max;
208
    }
209
210
    #[Override]
211
    public function setModuleLevel1Max(int $moduleLevel1Max): ShipRumpModuleLevelInterface
212
    {
213
        $this->module_level_1_max = $moduleLevel1Max;
214
215
        return $this;
216
    }
217
218 3
    #[Override]
219
    public function getModuleLevel2(): int
220
    {
221 3
        return $this->module_level_2;
222
    }
223
224
    #[Override]
225
    public function setModuleLevel2(int $moduleLevel2): ShipRumpModuleLevelInterface
226
    {
227
        $this->module_level_2 = $moduleLevel2;
228
229
        return $this;
230
    }
231
232 3
    #[Override]
233
    public function getModuleMandatory2(): bool
234
    {
235 3
        return $this->module_mandatory_2 === self::MODULE_MANDATORY;
236
    }
237
238
    #[Override]
239
    public function setModuleMandatory2(int $moduleMandatory2): ShipRumpModuleLevelInterface
240
    {
241
        $this->module_mandatory_2 = $moduleMandatory2;
242
243
        return $this;
244
    }
245
246 3
    #[Override]
247
    public function getModuleLevel2Min(): int
248
    {
249 3
        return $this->module_level_2_min;
250
    }
251
252
    #[Override]
253
    public function setModuleLevel2Min(int $moduleLevel2Min): ShipRumpModuleLevelInterface
254
    {
255
        $this->module_level_2_min = $moduleLevel2Min;
256
257
        return $this;
258
    }
259
260 3
    #[Override]
261
    public function getModuleLevel2Max(): int
262
    {
263 3
        return $this->module_level_2_max;
264
    }
265
266
    #[Override]
267
    public function setModuleLevel2Max(int $moduleLevel2Max): ShipRumpModuleLevelInterface
268
    {
269
        $this->module_level_2_max = $moduleLevel2Max;
270
271
        return $this;
272
    }
273
274 3
    #[Override]
275
    public function getModuleLevel3(): int
276
    {
277 3
        return $this->module_level_3;
278
    }
279
280
    #[Override]
281
    public function setModuleLevel3(int $moduleLevel3): ShipRumpModuleLevelInterface
282
    {
283
        $this->module_level_3 = $moduleLevel3;
284
285
        return $this;
286
    }
287
288 3
    #[Override]
289
    public function getModuleMandatory3(): bool
290
    {
291 3
        return $this->module_mandatory_3 === self::MODULE_MANDATORY;
292
    }
293
294
    #[Override]
295
    public function setModuleMandatory3(int $moduleMandatory3): ShipRumpModuleLevelInterface
296
    {
297
        $this->module_mandatory_3 = $moduleMandatory3;
298
299
        return $this;
300
    }
301
302 3
    #[Override]
303
    public function getModuleLevel3Min(): int
304
    {
305 3
        return $this->module_level_3_min;
306
    }
307
308
    #[Override]
309
    public function setModuleLevel3Min(int $moduleLevel3Min): ShipRumpModuleLevelInterface
310
    {
311
        $this->module_level_3_min = $moduleLevel3Min;
312
313
        return $this;
314
    }
315
316 3
    #[Override]
317
    public function getModuleLevel3Max(): int
318
    {
319 3
        return $this->module_level_3_max;
320
    }
321
322
    #[Override]
323
    public function setModuleLevel3Max(int $moduleLevel3Max): ShipRumpModuleLevelInterface
324
    {
325
        $this->module_level_3_max = $moduleLevel3Max;
326
327
        return $this;
328
    }
329
330 3
    #[Override]
331
    public function getModuleLevel4(): int
332
    {
333 3
        return $this->module_level_4;
334
    }
335
336
    #[Override]
337
    public function setModuleLevel4(int $moduleLevel4): ShipRumpModuleLevelInterface
338
    {
339
        $this->module_level_4 = $moduleLevel4;
340
341
        return $this;
342
    }
343
344 3
    #[Override]
345
    public function getModuleMandatory4(): bool
346
    {
347 3
        return $this->module_mandatory_4 === self::MODULE_MANDATORY;
348
    }
349
350
    #[Override]
351
    public function setModuleMandatory4(int $moduleMandatory4): ShipRumpModuleLevelInterface
352
    {
353
        $this->module_mandatory_4 = $moduleMandatory4;
354
355
        return $this;
356
    }
357
358 3
    #[Override]
359
    public function getModuleLevel4Min(): int
360
    {
361 3
        return $this->module_level_4_min;
362
    }
363
364
    #[Override]
365
    public function setModuleLevel4Min(int $moduleLevel4Min): ShipRumpModuleLevelInterface
366
    {
367
        $this->module_level_4_min = $moduleLevel4Min;
368
369
        return $this;
370
    }
371
372 3
    #[Override]
373
    public function getModuleLevel4Max(): int
374
    {
375 3
        return $this->module_level_4_max;
376
    }
377
378
    #[Override]
379
    public function setModuleLevel4Max(int $moduleLevel4Max): ShipRumpModuleLevelInterface
380
    {
381
        $this->module_level_4_max = $moduleLevel4Max;
382
383
        return $this;
384
    }
385
386 3
    #[Override]
387
    public function getModuleLevel5(): int
388
    {
389 3
        return $this->module_level_5;
390
    }
391
392
    #[Override]
393
    public function setModuleLevel5(int $moduleLevel5): ShipRumpModuleLevelInterface
394
    {
395
        $this->module_level_5 = $moduleLevel5;
396
397
        return $this;
398
    }
399
400 3
    #[Override]
401
    public function getModuleMandatory5(): bool
402
    {
403 3
        return $this->module_mandatory_5 === self::MODULE_MANDATORY;
404
    }
405
406
    #[Override]
407
    public function setModuleMandatory5(int $moduleMandatory5): ShipRumpModuleLevelInterface
408
    {
409
        $this->module_mandatory_5 = $moduleMandatory5;
410
411
        return $this;
412
    }
413
414 3
    #[Override]
415
    public function getModuleLevel5Min(): int
416
    {
417 3
        return $this->module_level_5_min;
418
    }
419
420
    #[Override]
421
    public function setModuleLevel5Min(int $moduleLevel5Min): ShipRumpModuleLevelInterface
422
    {
423
        $this->module_level_5_min = $moduleLevel5Min;
424
425
        return $this;
426
    }
427
428 3
    #[Override]
429
    public function getModuleLevel5Max(): int
430
    {
431 3
        return $this->module_level_5_max;
432
    }
433
434
    #[Override]
435
    public function setModuleLevel5Max(int $moduleLevel5Max): ShipRumpModuleLevelInterface
436
    {
437
        $this->module_level_5_max = $moduleLevel5Max;
438
439
        return $this;
440
    }
441
442 3
    #[Override]
443
    public function getModuleLevel6(): int
444
    {
445 3
        return $this->module_level_6;
446
    }
447
448
    #[Override]
449
    public function setModuleLevel6(int $moduleLevel6): ShipRumpModuleLevelInterface
450
    {
451
        $this->module_level_6 = $moduleLevel6;
452
453
        return $this;
454
    }
455
456 3
    #[Override]
457
    public function getModuleMandatory6(): bool
458
    {
459 3
        return $this->module_mandatory_6 === self::MODULE_MANDATORY;
460
    }
461
462
    #[Override]
463
    public function setModuleMandatory6(int $moduleMandatory6): ShipRumpModuleLevelInterface
464
    {
465
        $this->module_mandatory_6 = $moduleMandatory6;
466
467
        return $this;
468
    }
469
470 3
    #[Override]
471
    public function getModuleLevel6Min(): int
472
    {
473 3
        return $this->module_level_6_min;
474
    }
475
476
    #[Override]
477
    public function setModuleLevel6Min(int $moduleLevel6Min): ShipRumpModuleLevelInterface
478
    {
479
        $this->module_level_6_min = $moduleLevel6Min;
480
481
        return $this;
482
    }
483
484 3
    #[Override]
485
    public function getModuleLevel6Max(): int
486
    {
487 3
        return $this->module_level_6_max;
488
    }
489
490
    #[Override]
491
    public function setModuleLevel6Max(int $moduleLevel6Max): ShipRumpModuleLevelInterface
492
    {
493
        $this->module_level_6_max = $moduleLevel6Max;
494
495
        return $this;
496
    }
497
498 3
    #[Override]
499
    public function getModuleLevel7(): int
500
    {
501 3
        return $this->module_level_7;
502
    }
503
504
    #[Override]
505
    public function setModuleLevel7(int $moduleLevel7): ShipRumpModuleLevelInterface
506
    {
507
        $this->module_level_7 = $moduleLevel7;
508
509
        return $this;
510
    }
511
512 3
    #[Override]
513
    public function getModuleMandatory7(): bool
514
    {
515 3
        return $this->module_mandatory_7 === self::MODULE_MANDATORY;
516
    }
517
518
    #[Override]
519
    public function setModuleMandatory7(int $moduleMandatory7): ShipRumpModuleLevelInterface
520
    {
521
        $this->module_mandatory_7 = $moduleMandatory7;
522
523
        return $this;
524
    }
525
526 3
    #[Override]
527
    public function getModuleLevel7Min(): int
528
    {
529 3
        return $this->module_level_7_min;
530
    }
531
532
    #[Override]
533
    public function setModuleLevel7Min(int $moduleLevel7Min): ShipRumpModuleLevelInterface
534
    {
535
        $this->module_level_7_min = $moduleLevel7Min;
536
537
        return $this;
538
    }
539
540 3
    #[Override]
541
    public function getModuleLevel7Max(): int
542
    {
543 3
        return $this->module_level_7_max;
544
    }
545
546
    #[Override]
547
    public function setModuleLevel7Max(int $moduleLevel7Max): ShipRumpModuleLevelInterface
548
    {
549
        $this->module_level_7_max = $moduleLevel7Max;
550
551
        return $this;
552
    }
553
554 3
    #[Override]
555
    public function getModuleLevel8(): int
556
    {
557 3
        return $this->module_level_8;
558
    }
559
560
    #[Override]
561
    public function setModuleLevel8(int $moduleLevel8): ShipRumpModuleLevelInterface
562
    {
563
        $this->module_level_8 = $moduleLevel8;
564
565
        return $this;
566
    }
567
568
    #[Override]
569
    public function getModuleMandatory8(): bool
570
    {
571
        return $this->module_mandatory_8 === self::MODULE_MANDATORY;
572
    }
573
574
    #[Override]
575
    public function setModuleMandatory8(int $moduleMandatory8): ShipRumpModuleLevelInterface
576
    {
577
        $this->module_mandatory_8 = $moduleMandatory8;
578
579
        return $this;
580
    }
581
582 3
    #[Override]
583
    public function getModuleLevel8Min(): int
584
    {
585 3
        return $this->module_level_8_min;
586
    }
587
588
    #[Override]
589
    public function setModuleLevel8Min(int $moduleLevel8Min): ShipRumpModuleLevelInterface
590
    {
591
        $this->module_level_8_min = $moduleLevel8Min;
592
593
        return $this;
594
    }
595
596 3
    #[Override]
597
    public function getModuleLevel8Max(): int
598
    {
599 3
        return $this->module_level_8_max;
600
    }
601
602
    #[Override]
603
    public function setModuleLevel8Max(int $moduleLevel8Max): ShipRumpModuleLevelInterface
604
    {
605
        $this->module_level_8_max = $moduleLevel8Max;
606
607
        return $this;
608
    }
609
610 3
    #[Override]
611
    public function getModuleLevel10(): int
612
    {
613 3
        return $this->module_level_10;
614
    }
615
616
    #[Override]
617
    public function setModuleLevel10(int $moduleLevel10): ShipRumpModuleLevelInterface
618
    {
619
        $this->module_level_10 = $moduleLevel10;
620
621
        return $this;
622
    }
623
624 3
    #[Override]
625
    public function getModuleMandatory10(): bool
626
    {
627 3
        return $this->module_mandatory_10 === self::MODULE_MANDATORY;
628
    }
629
630
    #[Override]
631
    public function setModuleMandatory10(int $moduleMandatory10): ShipRumpModuleLevelInterface
632
    {
633
        $this->module_mandatory_10 = $moduleMandatory10;
634
635
        return $this;
636
    }
637
638 3
    #[Override]
639
    public function getModuleLevel10Min(): int
640
    {
641 3
        return $this->module_level_10_min;
642
    }
643
644
    #[Override]
645
    public function setModuleLevel10Min(int $moduleLevel10Min): ShipRumpModuleLevelInterface
646
    {
647
        $this->module_level_10_min = $moduleLevel10Min;
648
649
        return $this;
650
    }
651
652 3
    #[Override]
653
    public function getModuleLevel10Max(): int
654
    {
655 3
        return $this->module_level_10_max;
656
    }
657
658
    #[Override]
659
    public function setModuleLevel10Max(int $moduleLevel10Max): ShipRumpModuleLevelInterface
660
    {
661
        $this->module_level_10_max = $moduleLevel10Max;
662
663
        return $this;
664
    }
665
666 3
    #[Override]
667
    public function getModuleLevel11(): int
668
    {
669 3
        return $this->module_level_11;
670
    }
671
672
    #[Override]
673
    public function setModuleLevel11(int $moduleLevel11): ShipRumpModuleLevelInterface
674
    {
675
        $this->module_level_11 = $moduleLevel11;
676
677
        return $this;
678
    }
679
680 3
    #[Override]
681
    public function getModuleMandatory11(): bool
682
    {
683 3
        return $this->module_mandatory_11 === self::MODULE_MANDATORY;
684
    }
685
686
    #[Override]
687
    public function setModuleMandatory11(int $moduleMandatory11): ShipRumpModuleLevelInterface
688
    {
689
        $this->module_mandatory_11 = $moduleMandatory11;
690
691
        return $this;
692
    }
693
694 3
    #[Override]
695
    public function getModuleLevel11Min(): int
696
    {
697 3
        return $this->module_level_11_min;
698
    }
699
700
    #[Override]
701
    public function setModuleLevel11Min(int $moduleLevel11Min): ShipRumpModuleLevelInterface
702
    {
703
        $this->module_level_11_min = $moduleLevel11Min;
704
705
        return $this;
706
    }
707
708 3
    #[Override]
709
    public function getModuleLevel11Max(): int
710
    {
711 3
        return $this->module_level_11_max;
712
    }
713
714
    #[Override]
715
    public function setModuleLevel11Max(int $moduleLevel11Max): ShipRumpModuleLevelInterface
716
    {
717
        $this->module_level_11_max = $moduleLevel11Max;
718
719
        return $this;
720
    }
721
722
723
    #[Override]
724
    public function getMandatoryModulesCount(): int
725
    {
726
        return array_reduce(
727
            array_map(
728
                fn(SpacecraftModuleTypeEnum $type): string =>
729
                sprintf('getModuleMandatory%d', $type->value),
730
                array_filter(SpacecraftModuleTypeEnum::cases(), fn(SpacecraftModuleTypeEnum $type): bool => !$type->isSpecialSystemType())
731
            ),
732
            fn(int $value, string $method): int => $value + $this->$method() ? 1 : 0,
733
            0
734
        );
735
    }
736
}
737