Test Failed
Push — dev ( cc891d...2da33f )
by Janko
09:11
created

ShieldSystemData::setShieldRegenerationTimer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 1
cts 2
cp 0.5
crap 1.125
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Component\Spacecraft\System\Data;
6
7
use Override;
0 ignored issues
show
Bug introduced by
The type Override 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...
8
use Stu\Component\Spacecraft\System\SpacecraftSystemTypeEnum;
9
use Stu\Module\Template\StatusBarColorEnum;
0 ignored issues
show
Bug introduced by
The type Stu\Module\Template\StatusBarColorEnum 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...
10
11
class ShieldSystemData extends AbstractSystemData
12
{
13
    public int $shieldRegenerationTimer = 0;
14
15
    #[Override]
16
    public function getSystemType(): SpacecraftSystemTypeEnum
17
    {
18
        return SpacecraftSystemTypeEnum::SHIELDS;
19
    }
20
21
    public function setShieldRegenerationTimer(int $timestamp): ShieldSystemData
22
    {
23
        $this->shieldRegenerationTimer = $timestamp;
24
25 2
        return $this;
26
    }
27 2
28 2
    public function getShieldStatusBar(): string
29 2
    {
30 2
        return $this->getStatusBar(
31 2
            _('Schilde'),
32 2
            $this->spacecraft->getShield(),
33 2
            $this->spacecraft->getMaxShield(),
34
            $this->spacecraft->getShieldState() ? StatusBarColorEnum::STATUSBAR_SHIELD_ON : StatusBarColorEnum::STATUSBAR_SHIELD_OFF
35
        )
36 2
            ->render();
37
    }
38 2
39 2
    public function getShieldStatusBarBig(): String
40 2
    {
41 2
        return $this->getStatusBar(
42 2
            _('Schilde'),
43 2
            $this->spacecraft->getShield(),
44 2
            $this->spacecraft->getMaxShield(),
45 2
            $this->spacecraft->getShieldState() ? StatusBarColorEnum::STATUSBAR_SHIELD_ON : StatusBarColorEnum::STATUSBAR_SHIELD_OFF
46
        )
47
            ->setSizeModifier(1.6)
48
            ->render();
49
    }
50
}
51