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

StationCreator::createBy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 4
dl 0
loc 12
ccs 0
cts 6
cp 0
crap 2
rs 10
c 0
b 0
f 0
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