Test Failed
Push — dev ( d4c172...a63c79 )
by Janko
09:28
created

ManagerProviderFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getManagerProviderStation() 0 8 1
A getManagerProviderColony() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Lib\SpacecraftManagement\Provider;
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\Transfer\Storage\StorageManagerInterface;
9
use Stu\Module\Colony\Lib\ColonyLibFactoryInterface;
10
use Stu\Module\Crew\Lib\CrewCreatorInterface;
11
use Stu\Module\Spacecraft\Lib\Crew\TroopTransferUtilityInterface;
12
use Stu\Module\Station\Lib\StationWrapperInterface;
13
use Stu\Orm\Entity\ColonyInterface;
14
15
class ManagerProviderFactory implements ManagerProviderFactoryInterface
16
{
17
    public function __construct(
18
        private CrewCreatorInterface $crewCreator,
19
        private ColonyLibFactoryInterface $colonyLibFactory,
20
        private TroopTransferUtilityInterface $troopTransferUtility,
21
        private StorageManagerInterface $storageManager
22
    ) {}
23
24
    #[Override]
25
    public function getManagerProviderColony(ColonyInterface $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