Passed
Push — dev ( 392257...472d6e )
by Janko
10:08
created

ModuleViewEnum::getPhpPage()   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
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 49
    public function getPhpPage(): string
30
    {
31 49
        return sprintf('%s.php', $this->value);
32
    }
33
34 45
    public function getTitle(): string
35
    {
36 45
        return match ($this) {
37 45
            self::INDEX => 'Star Trek Universe - Login',
38 45
            self::GAME => 'Star Trek Universe',
39 45
            self::MAINDESK => 'Maindesk',
40 44
            self::COLONY => 'Kolonien',
41 44
            self::SHIP => 'Schiffe',
42 44
            self::STATION => 'Stationen',
43 44
            self::COMMUNICATION => 'KommNet',
44 44
            self::PM => 'Nachrichten',
45 44
            self::RESEARCH => 'Forschung',
46 44
            self::TRADE => 'Handel',
47 44
            self::ALLIANCE => 'Allianz',
48 44
            self::DATABASE => 'Datenbank',
49 44
            self::HISTORY => 'Ereignisse',
50 44
            self::MAP => 'Karte',
51
            self::NOTES => 'Notizen',
52
            self::OPTIONS => 'Optionen',
53
            self::PROFILE => 'Spielerprofil',
54
            self::ADMIN => 'Adminbereich',
55 45
            self::NPC => 'NPC'
56 45
        };
57
    }
58
59 44
    public function getTemplate(): string
60
    {
61 44
        return match ($this) {
62 44
            self::INDEX => 'html/index/index.twig',
63 44
            self::GAME => 'html/game/game.twig',
64 4
            self::MAINDESK => 'html/view/maindesk.twig',
65 4
            self::COLONY => 'html/view/colonylist.twig',
66 4
            self::SHIP => 'html/view/shiplist.twig',
67 4
            self::STATION => 'html/view/stationList.twig',
68 4
            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 44
            self::NPC => 'not needed'
81 44
        };
82
    }
83
}
84