Passed
Pull Request — dev (#2303)
by Janko
05:56
created

StationCreator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 25%

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 19
ccs 2
cts 8
cp 0.25
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A createBy() 0 12 1
1
<?php
2
3
namespace Stu\Module\Station\Lib\Creation;
4
5
use Stu\Module\Spacecraft\Lib\Creation\SpacecraftConfiguratorInterface;
6
use Stu\Module\Spacecraft\Lib\Creation\SpacecraftCreatorInterface;
7
use Stu\Module\Station\Lib\StationWrapperInterface;
8
use Stu\Orm\Entity\ConstructionProgress;
9
10
class StationCreator implements StationCreatorInterface
11
{
12
    /** @param SpacecraftCreatorInterface<StationWrapperInterface> $spacecraftCreator */
13 1
    public function __construct(
14
        private SpacecraftCreatorInterface $spacecraftCreator
15 1
    ) {}
16
17
    #[\Override]
18
    public function createBy(
19
        int $userId,
20
        int $rumpId,
21
        int $buildplanId,
22
        ConstructionProgress $progress
23
    ): SpacecraftConfiguratorInterface {
24
        return $this->spacecraftCreator->createBy(
25
            $userId,
26
            $rumpId,
27
            $buildplanId,
28
            new StationCreationConfig($progress)
29
        );
30
    }
31
}
32