Passed
Pull Request — dev (#2044)
by Nico
11:37
created

AstroStateWrapper::isSystem()   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 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 0
b 0
f 0
1
<?php
2
3
namespace Stu\Module\Ship\View\ShowShip;
4
5
use Stu\Component\Ship\AstronomicalMappingEnum;
0 ignored issues
show
Bug introduced by
The type Stu\Component\Ship\AstronomicalMappingEnum was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
class AstroStateWrapper
8
{
9 1
    public function __construct(private int $state, private ?int $turnsLeft, private bool $isSystem, private ?int $measurementpointsleft) {}
10
11 1
    public function isPlannable(): bool
12
    {
13 1
        return $this->state == AstronomicalMappingEnum::PLANNABLE;
14
    }
15
    public function isPlanned(): bool
16
    {
17
        return $this->state == AstronomicalMappingEnum::PLANNED;
18
    }
19
    public function isMeasured(): bool
20
    {
21
        return $this->state == AstronomicalMappingEnum::MEASURED;
22
    }
23
    public function isFinishing(): bool
24
    {
25
        return $this->state == AstronomicalMappingEnum::FINISHING;
26
    }
27
    public function isDone(): bool
28
    {
29
        return $this->state == AstronomicalMappingEnum::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 1
    public function isSystem(): bool
41
    {
42 1
        return $this->isSystem;
43
    }
44
45 1
    public function getType(): string
46
    {
47 1
        return $this->isSystem() ? 'System' : 'Region';
48
    }
49
}