Passed
Push — dev ( a6bda0...77805c )
by Nico
50:38 queued 26:27
created

ModuleViewEnum   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Test Coverage

Coverage 53.33%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 61
c 1
b 1
f 0
dl 0
loc 74
ccs 24
cts 45
cp 0.5333
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getPhpPage() 0 3 1
A getTitle() 0 22 1
A getTemplate() 0 22 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Component\Game;
6
7
enum ModuleViewEnum: string
8
{
9
    case INDEX = 'index';
10
    case GAME = 'game';
11
    case MAINDESK = 'maindesk';
12
    case COLONY = 'colony';
13
    case SHIP = 'ship';
14
    case STATION = 'station';
15
    case COMMUNICATION = 'comm';
16
    case PM = 'pm';
17
    case NOTES = 'notes';
18
    case RESEARCH = 'research';
19
    case TRADE = 'trade';
20
    case ALLIANCE = 'alliance';
21
    case DATABASE = 'database';
22
    case HISTORY = 'history';
23
    case MAP = 'starmap';
24
    case OPTIONS = 'options';
25
    case PROFILE = 'userprofile';
26
    case ADMIN = 'admin';
27
    case NPC = 'npc';
28
29 5
    public function getPhpPage(): string
30
    {
31 5
        return sprintf('%s.php', $this->value);
32
    }
33
34 1
    public function getTitle(): string
35
    {
36 1
        return match ($this) {
37 1
            self::INDEX => 'Star Trek Universe - Login',
38 1
            self::GAME => 'Star Trek Universe',
39 1
            self::MAINDESK => 'Maindesk',
40 1
            self::COLONY => 'Kolonien',
41 1
            self::SHIP => 'Schiffe',
42 1
            self::STATION => 'Stationen',
43 1
            self::COMMUNICATION => 'KommNet',
44 1
            self::PM => 'Nachrichten',
45 1
            self::RESEARCH => 'Forschung',
46 1
            self::TRADE => 'Handel',
47 1
            self::ALLIANCE => 'Allianz',
48 1
            self::DATABASE => 'Datenbank',
49 1
            self::HISTORY => 'Ereignisse',
50 1
            self::MAP => 'Karte',
51 1
            self::NOTES => 'Notizen',
52 1
            self::OPTIONS => 'Optionen',
53 1
            self::PROFILE => 'Spielerprofil',
54 1
            self::ADMIN => 'Adminbereich',
55 1
            self::NPC => 'NPC'
56 1
        };
57
    }
58
59
    public function getTemplate(): string
60
    {
61
        return match ($this) {
62
            self::INDEX => 'html/index.xhtml',
63
            self::GAME => 'html/game/game.twig',
64
            self::MAINDESK => 'html/view/maindesk.twig',
65
            self::COLONY => 'html/view/colonylist.twig',
66
            self::SHIP => 'html/view/shiplist.twig',
67
            self::STATION => 'html/view/stationList.twig',
68
            self::COMMUNICATION => 'html/view/communication.twig',
69
            self::PM => 'html/view/pmCategory.twig',
70
            self::RESEARCH => 'html/view/research.twig',
71
            self::TRADE => 'html/view/trade.twig',
72
            self::ALLIANCE => 'html/view/alliance.twig',
73
            self::DATABASE => 'html/view/database.twig',
74
            self::HISTORY => 'html/view/history.twig',
75
            self::MAP => 'html/view/map.twig',
76
            self::NOTES => 'not needed',
77
            self::OPTIONS => 'html/view/options.twig',
78
            self::PROFILE => 'html/view/userprofile.twig',
79
            self::ADMIN => 'not needed',
80
            self::NPC => 'not needed'
81
        };
82
    }
83
}
84