|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Stu\Lib\Map\VisualPanel\Layer\DataProvider\Shipcount; |
|
6
|
|
|
|
|
7
|
|
|
use Override; |
|
|
|
|
|
|
8
|
|
|
use RuntimeException; |
|
9
|
|
|
use Stu\Lib\Map\VisualPanel\Layer\DataProvider\AbstractPanelLayerDataProvider; |
|
10
|
|
|
use Stu\Orm\Repository\LocationRepositoryInterface; |
|
11
|
|
|
use Stu\Orm\Repository\MapRepositoryInterface; |
|
12
|
|
|
use Stu\Orm\Repository\StarSystemMapRepositoryInterface; |
|
13
|
|
|
|
|
14
|
|
|
final class ShipcountDataProviderFactory implements ShipcountDataProviderFactoryInterface |
|
15
|
|
|
{ |
|
16
|
2 |
|
public function __construct( |
|
17
|
|
|
private LocationRepositoryInterface $locationRepository, |
|
18
|
|
|
private MapRepositoryInterface $mapRepository, |
|
19
|
|
|
private StarSystemMapRepositoryInterface $starSystemMapRepository |
|
20
|
|
|
) { |
|
21
|
2 |
|
} |
|
22
|
|
|
|
|
23
|
|
|
#[Override] |
|
24
|
|
|
public function getDataProvider(int $id, ShipcountLayerTypeEnum $type): AbstractPanelLayerDataProvider |
|
25
|
|
|
{ |
|
26
|
|
|
switch ($type) { |
|
27
|
|
|
case ShipcountLayerTypeEnum::ALL: |
|
28
|
|
|
return new GeneralShipcountDataProvider($this->locationRepository, $this->mapRepository, $this->starSystemMapRepository); |
|
29
|
|
|
case ShipcountLayerTypeEnum::ALLIANCE_ONLY: |
|
30
|
|
|
return new AllianceShipcountDataProvider($id, $this->locationRepository, $this->mapRepository, $this->starSystemMapRepository); |
|
31
|
|
|
case ShipcountLayerTypeEnum::USER_ONLY: |
|
32
|
|
|
return new UserShipcountDataProvider($id, $this->locationRepository, $this->mapRepository, $this->starSystemMapRepository); |
|
33
|
|
|
case ShipcountLayerTypeEnum::SHIP_ONLY: |
|
34
|
|
|
return new ShipShipcountDataProvider($id, $this->locationRepository, $this->mapRepository, $this->starSystemMapRepository); |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
throw new RuntimeException(sprintf('Shipcount layer type %d is not supported', $type->value)); |
|
38
|
|
|
} |
|
39
|
|
|
} |
|
40
|
|
|
|
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