Test Failed
Pull Request — master (#2318)
by Nico
10:50 queued 05:24
created

getManagerProviderSpacecraft()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
ccs 0
cts 0
cp 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Lib\SpacecraftManagement\Provider;
6
7
use Stu\Lib\Transfer\Storage\StorageManagerInterface;
8
use Stu\Module\Colony\Lib\ColonyLibFactoryInterface;
9
use Stu\Module\Crew\Lib\CrewCreatorInterface;
10
use Stu\Module\Spacecraft\Lib\Crew\TroopTransferUtilityInterface;
11
use Stu\Module\Spacecraft\Lib\SpacecraftWrapperInterface;
12
use Stu\Module\Station\Lib\StationWrapperInterface;
13
use Stu\Orm\Entity\Colony;
14
15
class ManagerProviderFactory implements ManagerProviderFactoryInterface
16 1
{
17
    public function __construct(
18
        private CrewCreatorInterface $crewCreator,
19
        private ColonyLibFactoryInterface $colonyLibFactory,
20
        private TroopTransferUtilityInterface $troopTransferUtility,
21 1
        private StorageManagerInterface $storageManager
22
    ) {}
23
24
    #[\Override]
25
    public function getManagerProviderColony(Colony $colony): ManagerProviderInterface
26
    {
27
        return new ManagerProviderColony(
28
            $colony,
29
            $this->crewCreator,
30
            $this->colonyLibFactory,
31
            $this->storageManager,
32
            $this->troopTransferUtility
33
        );
34
    }
35
36
    #[\Override]
37
    public function getManagerProviderStation(StationWrapperInterface $wrapper): ManagerProviderInterface
38
    {
39
        return new ManagerProviderStation(
40
            $wrapper,
41
            $this->crewCreator,
42
            $this->troopTransferUtility,
43
            $this->storageManager
44
        );
45
    }
46
47
    #[\Override]
48
    public function getManagerProviderSpacecraft(SpacecraftWrapperInterface $wrapper): ManagerProviderInterface
49
    {
50
        return new ManagerProviderSpacecraft($wrapper);
51
    }
52
}
53