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

StationCreator::createBy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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