Passed
Push — dev ( 91186a...20d5e2 )
by Janko
05:17
created

AstroStateWrapper::isPlanned()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Stu\Module\Ship\View\ShowShip;
4
5
use Stu\Component\Ship\AstronomicalMappingStateEnum;
6
7
class AstroStateWrapper
8
{
9 2
    public function __construct(private AstronomicalMappingStateEnum $state, private ?int $turnsLeft, private bool $isSystem, private ?int $measurementpointsleft) {}
10
11 2
    public function isPlannable(): bool
12
    {
13 2
        return $this->state === AstronomicalMappingStateEnum::PLANNABLE;
14
    }
15 1
    public function isPlanned(): bool
16
    {
17 1
        return $this->state === AstronomicalMappingStateEnum::PLANNED;
18
    }
19 1
    public function isMeasured(): bool
20
    {
21 1
        return $this->state === AstronomicalMappingStateEnum::MEASURED;
22
    }
23 1
    public function isFinishing(): bool
24
    {
25 1
        return $this->state === AstronomicalMappingStateEnum::FINISHING;
26
    }
27 1
    public function isDone(): bool
28
    {
29 1
        return $this->state === AstronomicalMappingStateEnum::DONE;
30
    }
31
    public function getTurnsLeft(): ?int
32
    {
33
        return $this->turnsLeft;
34
    }
35
    public function getMeasurepointsLeft(): ?int
36
    {
37
        return $this->measurementpointsleft;
38
    }
39
40 2
    public function isSystem(): bool
41
    {
42 2
        return $this->isSystem;
43
    }
44
45 2
    public function getType(): string
46
    {
47 2
        return $this->isSystem() ? 'System' : 'Region';
48
    }
49
}
50