|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Stu\Module\Spacecraft\View\ShowSystemSettings; |
|
6
|
|
|
|
|
7
|
|
|
use RuntimeException; |
|
8
|
|
|
use Stu\Component\Spacecraft\System\SpacecraftSystemTypeEnum; |
|
9
|
|
|
use Stu\Exception\SanityCheckException; |
|
10
|
|
|
use Stu\Module\Control\GameControllerInterface; |
|
11
|
|
|
use Stu\Module\Ship\Lib\ShipWrapperInterface; |
|
12
|
|
|
use Stu\Module\Spacecraft\Lib\SpacecraftWrapperInterface; |
|
13
|
|
|
use Stu\Orm\Repository\LocationMiningRepositoryInterface; |
|
14
|
|
|
|
|
15
|
|
|
class BussardCollectorSystemSettings implements SystemSettingsProviderInterface |
|
16
|
|
|
{ |
|
17
|
1 |
|
public function __construct( |
|
18
|
|
|
private LocationMiningRepositoryInterface $locationMiningRepository |
|
19
|
1 |
|
) {} |
|
20
|
|
|
|
|
21
|
1 |
|
#[\Override] |
|
22
|
|
|
public function setTemplateVariables( |
|
23
|
|
|
SpacecraftSystemTypeEnum $systemType, |
|
24
|
|
|
SpacecraftWrapperInterface $wrapper, |
|
25
|
|
|
GameControllerInterface $game |
|
26
|
|
|
): void { |
|
27
|
1 |
|
if (!$wrapper instanceof ShipWrapperInterface) { |
|
28
|
|
|
throw new RuntimeException('this should not happen'); |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
1 |
|
$ship = $wrapper->get(); |
|
32
|
|
|
|
|
33
|
1 |
|
$game->setMacroInAjaxWindow('html/ship/bussardcollector.twig'); |
|
34
|
|
|
|
|
35
|
1 |
|
$collector = $wrapper->getBussardCollectorSystemData(); |
|
36
|
1 |
|
if ($collector === null) { |
|
37
|
|
|
throw new SanityCheckException( |
|
38
|
|
|
'no bussard collector installed', |
|
39
|
|
|
null, |
|
40
|
|
|
ShowSystemSettings::VIEW_IDENTIFIER |
|
|
|
|
|
|
41
|
|
|
); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
1 |
|
$mining = $this->locationMiningRepository->getMiningAtLocation($ship); |
|
45
|
1 |
|
$miningqueue = $ship->getMiningQueue(); |
|
46
|
1 |
|
$game->setTemplateVar('MINING', $mining); |
|
47
|
1 |
|
$game->setTemplateVar('MININGQUEUE', $miningqueue); |
|
48
|
|
|
} |
|
49
|
|
|
} |
|
50
|
|
|
|
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