Passed
Push — dev ( 91186a...20d5e2 )
by Janko
05:17
created

provideDataForSystemMap()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 1
dl 0
loc 9
ccs 7
cts 7
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Lib\Map\VisualPanel\Layer\DataProvider\Subspace;
6
7
use Override;
0 ignored issues
show
Bug introduced by
The type Override was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Stu\Lib\Map\VisualPanel\Layer\Data\SpacecraftSignatureData;
9
use Stu\Lib\Map\VisualPanel\PanelBoundaries;
10
use Stu\Module\Control\StuTime;
11
use Stu\Orm\Repository\LocationRepositoryInterface;
12
use Stu\Orm\Repository\MapRepositoryInterface;
13
use Stu\Orm\Repository\StarSystemMapRepositoryInterface;
14
15
final class ShipSubspaceDataProvider extends AbstractSubspaceDataProvider
16
{
17 1
    public function __construct(
18
        private int $shipId,
19
        private readonly StuTime $stuTime,
20
        LocationRepositoryInterface $locationRepository,
21
        MapRepositoryInterface $mapRepository,
22
        StarSystemMapRepositoryInterface $starSystemMapRepository,
23
        private ?int $rumpId = null
24
    ) {
25 1
        parent::__construct(
26 1
            $locationRepository,
27 1
            $mapRepository,
28 1
            $starSystemMapRepository
29 1
        );
30
    }
31
32 1
    #[Override]
33
    protected function getDataClassString(): string
34
    {
35 1
        return SpacecraftSignatureData::class;
36
    }
37
38
    #[Override]
39
    protected function provideDataForMap(PanelBoundaries $boundaries): array
40
    {
41
        return $this->mapRepository->getShipSubspaceLayerData(
42
            $boundaries,
43
            $this->shipId,
44
            $this->stuTime->time(),
45
            $this->createResultSetMapping(),
46
            true,
47
            $this->rumpId
48
        );
49
    }
50
51 1
    #[Override]
52
    protected function provideDataForSystemMap(PanelBoundaries $boundaries): array
53
    {
54 1
        return $this->starSystemMapRepository->getShipSubspaceLayerData(
55 1
            $boundaries,
56 1
            $this->shipId,
57 1
            $this->stuTime->time(),
58 1
            $this->createResultSetMapping(),
59 1
            $this->rumpId
60 1
        );
61
    }
62
}
63