Passed
Push — dev ( 04bdae...5ade2a )
by Janko
28:32
created

UserSubspaceDataProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 21
ccs 0
cts 7
cp 0
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A provideDataForSystemMap() 0 3 1
A provideDataForMap() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Lib\Map\VisualPanel\Layer\DataProvider\Subspace;
6
7
use Crunz\Exception\NotImplementedException;
8
use Stu\Lib\Map\VisualPanel\PanelBoundaries;
9
use Stu\Orm\Repository\MapRepositoryInterface;
10
use Stu\Orm\Repository\StarSystemMapRepositoryInterface;
11
12
final class UserSubspaceDataProvider extends AbstractSubspaceDataProvider
13
{
14
    private int $userId;
15
16
    public function __construct( #
17
        int $userId,
18
        MapRepositoryInterface $mapRepository,
19
        StarSystemMapRepositoryInterface $starSystemMapRepository
20
    ) {
21
        parent::__construct($mapRepository, $starSystemMapRepository);
22
        $this->userId = $userId;
23
    }
24
25
    protected function provideDataForMap(PanelBoundaries $boundaries): array
26
    {
27
        return $this->mapRepository->getUserSubspaceLayerData($boundaries, $this->userId, $this->createResultSetMapping());
28
    }
29
30
    protected function provideDataForSystemMap(PanelBoundaries $boundaries): array
31
    {
32
        throw new NotImplementedException('this is not possible');
33
    }
34
}
35