|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Stu\Lib\Map\VisualPanel\Layer\DataProvider; |
|
6
|
|
|
|
|
7
|
|
|
use Doctrine\ORM\Query\ResultSetMapping; |
|
8
|
|
|
use Override; |
|
|
|
|
|
|
9
|
|
|
use Stu\Lib\Map\VisualPanel\Layer\Data\CellDataInterface; |
|
10
|
|
|
use Stu\Lib\Map\VisualPanel\PanelBoundaries; |
|
11
|
|
|
use Stu\Orm\Repository\LocationRepositoryInterface; |
|
12
|
|
|
use Stu\Orm\Repository\MapRepositoryInterface; |
|
13
|
|
|
use Stu\Orm\Repository\StarSystemMapRepositoryInterface; |
|
14
|
|
|
|
|
15
|
|
|
abstract class AbstractPanelLayerDataProvider implements PanelLayerDataProviderInterface |
|
16
|
|
|
{ |
|
17
|
2 |
|
public function __construct( |
|
18
|
|
|
protected LocationRepositoryInterface $locationRepository, |
|
19
|
|
|
protected MapRepositoryInterface $mapRepository, |
|
20
|
|
|
protected StarSystemMapRepositoryInterface $starSystemMapRepository |
|
21
|
|
|
) { |
|
22
|
2 |
|
} |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* @return string The class name of the entity. |
|
26
|
|
|
* @psalm-return class-string |
|
27
|
|
|
*/ |
|
28
|
|
|
abstract protected function getDataClassString(): string; |
|
29
|
|
|
|
|
30
|
|
|
abstract protected function addFieldResults(ResultSetMapping $rsm): void; |
|
31
|
|
|
|
|
32
|
|
|
/** @return array<CellDataInterface> */ |
|
33
|
|
|
abstract protected function provideDataForMap(PanelBoundaries $boundaries): array; |
|
34
|
|
|
|
|
35
|
|
|
/** @return array<CellDataInterface> */ |
|
36
|
|
|
abstract protected function provideDataForSystemMap(PanelBoundaries $boundaries): array; |
|
37
|
|
|
|
|
38
|
|
|
#[Override] |
|
39
|
|
|
public function loadData(PanelBoundaries $boundaries): array |
|
40
|
|
|
{ |
|
41
|
|
|
if ($boundaries->isOnMap()) { |
|
42
|
|
|
|
|
43
|
|
|
return $this->provideDataForMap($boundaries); |
|
44
|
|
|
} else { |
|
45
|
|
|
|
|
46
|
|
|
return $this->provideDataForSystemMap($boundaries); |
|
47
|
|
|
} |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
protected function createResultSetMapping(): ResultSetMapping |
|
51
|
|
|
{ |
|
52
|
|
|
$rsm = new ResultSetMapping(); |
|
53
|
|
|
$rsm->addEntityResult($this->getDataClassString(), 'd'); |
|
54
|
|
|
$rsm->addFieldResult('d', 'x', 'x'); |
|
55
|
|
|
$rsm->addFieldResult('d', 'y', 'y'); |
|
56
|
|
|
|
|
57
|
|
|
$this->addFieldResults($rsm); |
|
58
|
|
|
|
|
59
|
|
|
return $rsm; |
|
60
|
|
|
} |
|
61
|
|
|
} |
|
62
|
|
|
|
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