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 readonly ShipRepositoryInterface $shipRepository, |
20
|
|
|
private readonly SpacecraftSystemRepositoryInterface $shipSystemRepository, |
21
|
|
|
private readonly TholianWebRepositoryInterface $tholianWebRepository, |
22
|
|
|
private readonly StatusBarFactoryInterface $statusBarFactory |
23
|
1 |
|
) {} |
24
|
|
|
|
25
|
22 |
|
#[Override] |
26
|
|
|
public function createSystemData( |
27
|
|
|
SpacecraftSystemTypeEnum $systemType, |
28
|
|
|
SpacecraftWrapperFactoryInterface $spacecraftWrapperFactory |
29
|
|
|
): AbstractSystemData { |
30
|
|
|
|
31
|
|
|
return match ($systemType) { |
32
|
22 |
|
SpacecraftSystemTypeEnum::HULL => new HullSystemData($this->shipSystemRepository, $this->statusBarFactory), |
33
|
18 |
|
SpacecraftSystemTypeEnum::SHIELDS => new ShieldSystemData($this->shipSystemRepository, $this->statusBarFactory), |
34
|
18 |
|
SpacecraftSystemTypeEnum::EPS => new EpsSystemData($this->shipSystemRepository, $this->statusBarFactory), |
35
|
13 |
|
SpacecraftSystemTypeEnum::COMPUTER => new ComputerSystemData($this->shipSystemRepository, $this->statusBarFactory), |
36
|
12 |
|
SpacecraftSystemTypeEnum::TRACKER => new TrackerSystemData($this->shipRepository, $spacecraftWrapperFactory, $this->shipSystemRepository, $this->statusBarFactory), |
37
|
12 |
|
SpacecraftSystemTypeEnum::THOLIAN_WEB => new WebEmitterSystemData($this->shipSystemRepository, $this->tholianWebRepository, $this->statusBarFactory), |
38
|
11 |
|
SpacecraftSystemTypeEnum::WARPDRIVE => new WarpDriveSystemData($this->shipSystemRepository, $this->statusBarFactory), |
39
|
9 |
|
SpacecraftSystemTypeEnum::WARPCORE => new WarpCoreSystemData($this->shipSystemRepository, $this->statusBarFactory), |
40
|
6 |
|
SpacecraftSystemTypeEnum::SINGULARITY_REACTOR => new SingularityCoreSystemData($this->shipSystemRepository, $this->statusBarFactory), |
41
|
6 |
|
SpacecraftSystemTypeEnum::FUSION_REACTOR => new FusionCoreSystemData($this->shipSystemRepository, $this->statusBarFactory), |
42
|
6 |
|
SpacecraftSystemTypeEnum::ASTRO_LABORATORY => new AstroLaboratorySystemData($this->shipSystemRepository, $this->statusBarFactory), |
43
|
6 |
|
SpacecraftSystemTypeEnum::PHASER => new EnergyWeaponSystemData($this->shipSystemRepository, $this->statusBarFactory), |
44
|
6 |
|
SpacecraftSystemTypeEnum::TORPEDO => new ProjectileLauncherSystemData($this->shipSystemRepository, $this->statusBarFactory), |
45
|
6 |
|
SpacecraftSystemTypeEnum::BUSSARD_COLLECTOR => new BussardCollectorSystemData($this->shipSystemRepository, $this->statusBarFactory), |
46
|
5 |
|
SpacecraftSystemTypeEnum::AGGREGATION_SYSTEM => new AggregationSystemSystemData($this->shipSystemRepository, $this->statusBarFactory), |
47
|
4 |
|
SpacecraftSystemTypeEnum::LSS => new LssSystemData($this->shipSystemRepository, $this->statusBarFactory), |
48
|
|
|
SpacecraftSystemTypeEnum::SUBSPACE_SCANNER => new SubspaceSystemData($this->shipSystemRepository, $this->statusBarFactory), |
49
|
|
|
|
50
|
22 |
|
default => throw new InvalidSystemException(sprintf('no system data present for systemType: %d', $systemType->value)) |
51
|
|
|
}; |
52
|
|
|
} |
53
|
|
|
} |
54
|
|
|
|
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