|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Stu\Module\Colony\Lib\Gui; |
|
6
|
|
|
|
|
7
|
|
|
use Override; |
|
|
|
|
|
|
8
|
|
|
use Stu\Component\Colony\ColonyMenuEnum; |
|
9
|
|
|
use Stu\Lib\Colony\PlanetFieldHostInterface; |
|
10
|
|
|
use Stu\Lib\Component\ComponentRegistrationInterface; |
|
11
|
|
|
use Stu\Module\Control\GameControllerInterface; |
|
12
|
|
|
use Stu\Orm\Entity\ColonySandboxInterface; |
|
13
|
|
|
|
|
14
|
|
|
final class ColonyGuiHelper implements ColonyGuiHelperInterface |
|
15
|
|
|
{ |
|
16
|
1 |
|
public function __construct(private ComponentRegistrationInterface $componentRegistration) {} |
|
17
|
|
|
|
|
18
|
18 |
|
#[Override] |
|
19
|
|
|
public function registerMenuComponents( |
|
20
|
|
|
ColonyMenuEnum $menu, |
|
21
|
|
|
PlanetFieldHostInterface $host, |
|
22
|
|
|
GameControllerInterface $game |
|
23
|
|
|
): void { |
|
24
|
|
|
|
|
25
|
18 |
|
foreach ($menu->getNecessaryGuiComponents() as $componentEnum) { |
|
26
|
16 |
|
$this->componentRegistration->registerComponent($componentEnum, $host); |
|
27
|
|
|
} |
|
28
|
|
|
|
|
29
|
18 |
|
$game->setTemplateVar('HOST', $host); |
|
30
|
18 |
|
$game->setTemplateVar('CURRENT_MENU', $menu); |
|
31
|
|
|
|
|
32
|
18 |
|
if ($host instanceof ColonySandboxInterface) { |
|
33
|
|
|
$game->setTemplateVar('COLONY', $host->getColony()); |
|
34
|
|
|
} else { |
|
35
|
18 |
|
$game->setTemplateVar('COLONY', $host); |
|
36
|
|
|
} |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
1 |
|
#[Override] |
|
40
|
|
|
public function registerComponents( |
|
41
|
|
|
PlanetFieldHostInterface $host, |
|
42
|
|
|
GameControllerInterface $game, |
|
43
|
|
|
array $guiComponents |
|
44
|
|
|
): void { |
|
45
|
1 |
|
foreach ($guiComponents as $componentEnum) { |
|
46
|
1 |
|
$this->componentRegistration->registerComponent($componentEnum, $host); |
|
47
|
|
|
} |
|
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