Passed
Pull Request — master (#2311)
by Nico
07:31 queued 02:09
created

StationCreator::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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