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\SpacecraftSystemTypeEnum; |
9
|
|
|
use Stu\Module\Template\StatusBarFactoryInterface; |
10
|
|
|
use Stu\Orm\Entity\Spacecraft; |
11
|
|
|
use Stu\Orm\Repository\SpacecraftSystemRepositoryInterface; |
12
|
|
|
|
13
|
|
|
class SubspaceSystemData extends AbstractSystemData |
14
|
|
|
{ |
15
|
|
|
public ?int $spacecraftId = null; |
16
|
|
|
public ?int $analyzeTime = null; |
17
|
|
|
public ?int $flightSigId = null; |
18
|
|
|
|
19
|
|
|
public function __construct( |
20
|
|
|
SpacecraftSystemRepositoryInterface $shipSystemRepository, |
21
|
|
|
StatusBarFactoryInterface $statusBarFactory |
22
|
|
|
) { |
23
|
|
|
parent::__construct($shipSystemRepository, $statusBarFactory); |
24
|
|
|
} |
25
|
|
|
|
26
|
|
|
#[Override] |
27
|
|
|
public function getSystemType(): SpacecraftSystemTypeEnum |
28
|
|
|
{ |
29
|
|
|
return SpacecraftSystemTypeEnum::SUBSPACE_SCANNER; |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
public function getSpacecraftId(): ?int |
33
|
|
|
{ |
34
|
|
|
return $this->spacecraftId ?? null; |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
public function setSpacecraftId(?int $spacecraftId): SubspaceSystemData |
38
|
|
|
{ |
39
|
|
|
$this->spacecraftId = $spacecraftId; |
40
|
|
|
return $this; |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
public function getAnalyzeTime(): ?int |
44
|
|
|
{ |
45
|
|
|
return $this->analyzeTime ?? null; |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
public function setAnalyzeTime(?int $analyzeTime): SubspaceSystemData |
49
|
|
|
{ |
50
|
|
|
$this->analyzeTime = $analyzeTime; |
51
|
|
|
return $this; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function getFlightSigId(): ?int |
55
|
|
|
{ |
56
|
|
|
return $this->flightSigId ?? null; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function setFlightSigId(?int $flightSigId): SubspaceSystemData |
60
|
|
|
{ |
61
|
|
|
$this->flightSigId = $flightSigId; |
62
|
|
|
return $this; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
public function getHighlightedSpacecraftId(Spacecraft $spacecraft): ?int |
66
|
|
|
{ |
67
|
|
|
$isSubspaceScannerActive = $spacecraft->getSystemState(SpacecraftSystemTypeEnum::SUBSPACE_SCANNER); |
68
|
|
|
if (!$isSubspaceScannerActive) { |
69
|
|
|
return null; |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
$isMatrixScannerHealthy = $spacecraft->isSystemHealthy(SpacecraftSystemTypeEnum::MATRIX_SCANNER); |
73
|
|
|
if (!$isMatrixScannerHealthy) { |
74
|
|
|
return null; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
$subspaceSystem = $spacecraft->getSpacecraftSystem(SpacecraftSystemTypeEnum::SUBSPACE_SCANNER); |
78
|
|
|
if ($subspaceSystem->getData() === null) { |
79
|
|
|
return null; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
$analyzeTime = $this->getAnalyzeTime(); |
83
|
|
|
if ($analyzeTime === null) { |
84
|
|
|
return null; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
$currentTime = time(); |
88
|
|
|
$minTime = $analyzeTime + (3 * 60); |
89
|
|
|
$maxTime = $analyzeTime + (10 * 60); |
90
|
|
|
|
91
|
|
|
if (!($currentTime >= $minTime && $currentTime <= $maxTime)) { |
92
|
|
|
return null; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
return $this->getSpacecraftId(); |
96
|
|
|
} |
97
|
|
|
} |
98
|
|
|
|
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