|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Stu\Lib\Map\VisualPanel\Layer\DataProvider\Border; |
|
6
|
|
|
|
|
7
|
|
|
use Override; |
|
|
|
|
|
|
8
|
|
|
use RuntimeException; |
|
9
|
|
|
use Stu\Component\Spacecraft\SpacecraftLssModeEnum; |
|
10
|
|
|
use Stu\Lib\Map\VisualPanel\Layer\DataProvider\AbstractPanelLayerDataProvider; |
|
11
|
|
|
use Stu\Orm\Repository\LocationRepositoryInterface; |
|
12
|
|
|
use Stu\Orm\Repository\MapRepositoryInterface; |
|
13
|
|
|
use Stu\Orm\Repository\StarSystemMapRepositoryInterface; |
|
14
|
|
|
use Stu\Orm\Entity\SpacecraftInterface; |
|
15
|
|
|
use Stu\Orm\Repository\AstroEntryRepositoryInterface; |
|
16
|
|
|
|
|
17
|
|
|
final class BorderDataProviderFactory implements BorderDataProviderFactoryInterface |
|
18
|
|
|
{ |
|
19
|
2 |
|
public function __construct( |
|
20
|
|
|
private LocationRepositoryInterface $locationRepository, |
|
21
|
|
|
private MapRepositoryInterface $mapRepository, |
|
22
|
|
|
private StarSystemMapRepositoryInterface $starSystemMapRepository, |
|
23
|
|
|
private AstroEntryRepositoryInterface $astroEntryRepository |
|
24
|
2 |
|
) {} |
|
25
|
|
|
|
|
26
|
1 |
|
#[Override] |
|
27
|
|
|
public function getDataProvider(?SpacecraftInterface $currentSpacecraft, ?bool $isOnShipLevel): AbstractPanelLayerDataProvider |
|
28
|
|
|
{ |
|
29
|
|
|
|
|
30
|
1 |
|
if ($currentSpacecraft != null) { |
|
31
|
|
|
|
|
32
|
1 |
|
switch ($currentSpacecraft->getLssMode()) { |
|
33
|
1 |
|
case SpacecraftLssModeEnum::NORMAL: |
|
34
|
1 |
|
return new NormalBorderDataProvider($this->locationRepository, $this->mapRepository, $this->starSystemMapRepository); |
|
35
|
|
|
case SpacecraftLssModeEnum::BORDER: |
|
36
|
|
|
return new RegionBorderDataProvider($this->locationRepository, $this->mapRepository, $this->starSystemMapRepository); |
|
37
|
|
|
case SpacecraftLssModeEnum::IMPASSABLE: |
|
38
|
|
|
return new ImpassableBorderDataProvider($currentSpacecraft, $this->mapRepository, $this->starSystemMapRepository); |
|
39
|
|
|
case SpacecraftLssModeEnum::CARTOGRAPHING: |
|
40
|
|
|
return new CartographyBorderDataProvider($currentSpacecraft, $this->mapRepository, $this->starSystemMapRepository, $this->astroEntryRepository); |
|
41
|
|
|
} |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
|
|
45
|
|
|
throw new RuntimeException(sprintf('border type is not supported')); |
|
46
|
|
|
} |
|
47
|
|
|
} |
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