Passed
Push — dev ( d85471...98511f )
by Janko
18:01
created

StationCreator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 14.29%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 17
ccs 1
cts 7
cp 0.1429
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 1 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\ConstructionProgressInterface;
9
10
class StationCreator implements StationCreatorInterface
11
{
12
    /** @param SpacecraftCreatorInterface<StationWrapperInterface> $spacecraftCreator */
13 1
    public function __construct(private SpacecraftCreatorInterface $spacecraftCreator) {}
14
15
    public function createBy(
16
        int $userId,
17
        int $rumpId,
18
        int $buildplanId,
19
        ConstructionProgressInterface $progress
20
    ): SpacecraftConfiguratorInterface {
21
22
        return $this->spacecraftCreator->createBy(
23
            $userId,
24
            $rumpId,
25
            $buildplanId,
26
            new StationCreationConfig($progress)
27
        );
28
    }
29
}
30