Passed
Push — dev ( 857b11...ce9e84 )
by Janko
16:15
created

ColonyComponentEnum::getValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Module\Colony\Component;
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\Game\ModuleEnum;
9
use Stu\Lib\Component\ComponentEnumInterface;
10
11
enum ColonyComponentEnum: string implements ComponentEnumInterface
12
{
13
    // mainscreen
14
    case SHIELDING = 'SHIELDING';
15
    case EPS_BAR = 'EPS_BAR';
16
    case SURFACE = 'SURFACE';
17
    case STORAGE = 'STORAGE';
18
19
        // submenues
20
    case MANAGEMENT = 'MANAGEMENT';
21
    case EFFECTS = 'EFFECTS';
22
    case BUILD_MENUES = 'BUILD_MENUES';
23
    case SOCIAL = 'SOCIAL';
24
    case BUILDING_MANAGEMENT = 'BUILDING_MANAGEMENT';
25
26
        // menues
27
    case ACADEMY = 'ACADEMY';
28
    case AIRFIELD = 'AIRFIELD';
29
    case MODULE_FAB = 'MODULE_FAB';
30
    case TORPEDO_FAB = 'TORPEDO_FAB';
31
    case SHIPYARD = 'SHIPYARD';
32
    case FIGHTER_SHIPYARD = 'FIGHTER_SHIPYARD';
33
    case SHIP_BUILDPLANS = 'SHIP_BUILDPLANS';
34
    case SHIP_REPAIR = 'SHIP_REPAIR';
35
    case SHIP_DISASSEMBLY = 'SHIP_DISASSEMBLY';
36
    case SHIP_RETROFIT = 'SHIP_RETROFIT';
37
38 22
    #[Override]
39
    public function getModuleView(): ModuleEnum
40
    {
41 22
        return ModuleEnum::COLONY;
42
    }
43
44 22
    #[Override]
45
    public function getTemplate(): string
46
    {
47 22
        return match ($this) {
48 22
            self::SHIELDING => 'html/colony/component/colonyShields.twig',
49 20
            self::EPS_BAR => 'html/colony/component/colonyEps.twig',
50 19
            self::SURFACE => 'html/colony/component/colonySurface.twig',
51 17
            self::STORAGE => 'html/colony/component/colonyStorage.twig',
52 22
            default => ''
53 22
        };
54
    }
55
56
    #[Override]
57
    public function getRefreshIntervalInSeconds(): ?int
58
    {
59
        return null;
60
    }
61
62 21
    #[Override]
63
    public function hasTemplateVariables(): bool
64
    {
65 21
        return true;
66
    }
67
68 22
    #[Override]
69
    public function getValue(): string
70
    {
71 22
        return $this->name;
0 ignored issues
show
Bug Best Practice introduced by
The property name does not exist on Stu\Module\Colony\Component\ColonyComponentEnum. Did you maybe forget to declare it?
Loading history...
72
    }
73
}
74