1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Stu\Component\Spacecraft\System\Data; |
6
|
|
|
|
7
|
|
|
use Override; |
|
|
|
|
8
|
|
|
use Stu\Component\Spacecraft\System\Exception\InvalidSystemException; |
9
|
|
|
use Stu\Component\Spacecraft\System\SpacecraftSystemTypeEnum; |
10
|
|
|
use Stu\Module\Spacecraft\Lib\SpacecraftWrapperFactoryInterface; |
11
|
|
|
use Stu\Module\Template\StatusBarFactoryInterface; |
12
|
|
|
use Stu\Orm\Repository\ShipRepositoryInterface; |
13
|
|
|
use Stu\Orm\Repository\SpacecraftSystemRepositoryInterface; |
14
|
|
|
use Stu\Orm\Repository\TholianWebRepositoryInterface; |
15
|
|
|
|
16
|
|
|
final class ShipSystemDataFactory implements ShipSystemDataFactoryInterface |
17
|
|
|
{ |
18
|
1 |
|
public function __construct( |
19
|
|
|
private ShipRepositoryInterface $shipRepository, |
20
|
|
|
private SpacecraftSystemRepositoryInterface $shipSystemRepository, |
21
|
|
|
private TholianWebRepositoryInterface $tholianWebRepository, |
22
|
|
|
private StatusBarFactoryInterface $statusBarFactory |
23
|
|
|
|
24
|
1 |
|
) {} |
25
|
|
|
|
26
|
13 |
|
#[Override] |
27
|
|
|
public function createSystemData( |
28
|
|
|
SpacecraftSystemTypeEnum $systemType, |
29
|
|
|
SpacecraftWrapperFactoryInterface $spacecraftWrapperFactory |
30
|
|
|
): AbstractSystemData { |
31
|
|
|
switch ($systemType) { |
32
|
13 |
|
case SpacecraftSystemTypeEnum::SYSTEM_HULL: |
33
|
8 |
|
return new HullSystemData( |
34
|
8 |
|
$this->shipSystemRepository, |
35
|
8 |
|
$this->statusBarFactory |
36
|
8 |
|
); |
37
|
9 |
|
case SpacecraftSystemTypeEnum::SYSTEM_SHIELDS: |
38
|
4 |
|
return new ShieldSystemData( |
39
|
4 |
|
$this->shipSystemRepository, |
40
|
4 |
|
$this->statusBarFactory |
41
|
4 |
|
); |
42
|
9 |
|
case SpacecraftSystemTypeEnum::SYSTEM_EPS: |
43
|
9 |
|
return new EpsSystemData( |
44
|
9 |
|
$this->shipSystemRepository, |
45
|
9 |
|
$this->statusBarFactory |
46
|
9 |
|
); |
47
|
5 |
|
case SpacecraftSystemTypeEnum::SYSTEM_TRACKER: |
48
|
|
|
return new TrackerSystemData( |
49
|
|
|
$this->shipRepository, |
50
|
|
|
$spacecraftWrapperFactory, |
51
|
|
|
$this->shipSystemRepository, |
52
|
|
|
$this->statusBarFactory |
53
|
|
|
); |
54
|
5 |
|
case SpacecraftSystemTypeEnum::SYSTEM_THOLIAN_WEB: |
55
|
|
|
return new WebEmitterSystemData( |
56
|
|
|
$this->shipSystemRepository, |
57
|
|
|
$this->tholianWebRepository, |
58
|
|
|
$this->statusBarFactory |
59
|
|
|
); |
60
|
5 |
|
case SpacecraftSystemTypeEnum::SYSTEM_WARPDRIVE: |
61
|
3 |
|
return new WarpDriveSystemData( |
62
|
3 |
|
$this->shipSystemRepository, |
63
|
3 |
|
$this->statusBarFactory |
64
|
3 |
|
); |
65
|
5 |
|
case SpacecraftSystemTypeEnum::SYSTEM_WARPCORE: |
66
|
5 |
|
return new WarpCoreSystemData( |
67
|
5 |
|
$this->shipSystemRepository, |
68
|
5 |
|
$this->statusBarFactory |
69
|
5 |
|
); |
70
|
|
|
case SpacecraftSystemTypeEnum::SYSTEM_SINGULARITY_REACTOR: |
71
|
|
|
return new SingularityCoreSystemData( |
72
|
|
|
$this->shipSystemRepository, |
73
|
|
|
$this->statusBarFactory |
74
|
|
|
); |
75
|
|
|
case SpacecraftSystemTypeEnum::SYSTEM_FUSION_REACTOR: |
76
|
|
|
return new FusionCoreSystemData( |
77
|
|
|
$this->shipSystemRepository, |
78
|
|
|
$this->statusBarFactory |
79
|
|
|
); |
80
|
|
|
case SpacecraftSystemTypeEnum::SYSTEM_ASTRO_LABORATORY: |
81
|
|
|
return new AstroLaboratorySystemData( |
82
|
|
|
$this->shipSystemRepository, |
83
|
|
|
$this->statusBarFactory |
84
|
|
|
); |
85
|
|
|
case SpacecraftSystemTypeEnum::SYSTEM_TORPEDO: |
86
|
|
|
return new ProjectileLauncherSystemData( |
87
|
|
|
$this->shipSystemRepository, |
88
|
|
|
$this->statusBarFactory |
89
|
|
|
); |
90
|
|
|
case SpacecraftSystemTypeEnum::SYSTEM_BUSSARD_COLLECTOR: |
91
|
|
|
return new BussardCollectorSystemData( |
92
|
|
|
$this->shipSystemRepository, |
93
|
|
|
$this->statusBarFactory |
94
|
|
|
); |
95
|
|
|
case SpacecraftSystemTypeEnum::SYSTEM_AGGREGATION_SYSTEM: |
96
|
|
|
return new AggregationSystemSystemData( |
97
|
|
|
$this->shipSystemRepository, |
98
|
|
|
$this->statusBarFactory |
99
|
|
|
); |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
throw new InvalidSystemException(sprintf('no system data present for systemType: %d', $systemType->value)); |
103
|
|
|
} |
104
|
|
|
} |
105
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths