Test Failed
Push — master ( bbdbb0...ecc533 )
by Nico
16:37 queued 10:47
created

WarpcoreChargeTransferSystemData   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getSystemType() 0 4 1
A isUseable() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Component\Spacecraft\System\Data;
6
7
use Stu\Component\Spacecraft\System\SpacecraftSystemTypeEnum;
8
use Stu\Module\Template\StatusBarFactoryInterface;
9
use Stu\Orm\Repository\SpacecraftSystemRepositoryInterface;
10
11
class WarpcoreChargeTransferSystemData extends AbstractSystemData
12
{
13
    public function __construct(
14
        SpacecraftSystemRepositoryInterface $shipSystemRepository,
15
        StatusBarFactoryInterface $statusBarFactory
16
    ) {
17
        parent::__construct($shipSystemRepository, $statusBarFactory);
18
    }
19
20
    #[\Override]
21
    public function getSystemType(): SpacecraftSystemTypeEnum
22
    {
23
        return SpacecraftSystemTypeEnum::WARPCORE_CHARGE_TRANSFER;
24
    }
25
26
    public function isUseable(): bool
27
    {
28
        return $this->spacecraft->getSpacecraftSystem(SpacecraftSystemTypeEnum::WARPCORE_CHARGE_TRANSFER)->getMode()->isActivated();
29
    }
30
}