Passed
Pull Request — master (#1930)
by Janko
14:58 queued 05:13
created

ShowPadd   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 10
c 3
b 0
f 0
dl 0
loc 14
ccs 0
cts 8
cp 0
rs 10
wmc 4
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Module\Game\View\ShowPadd;
6
7
use Override;
8
use Stu\Module\Control\GameControllerInterface;
9
use Stu\Module\Control\ViewControllerInterface;
10
use Stu\Component\Faction\FactionEnum;
11
12
final class ShowPadd implements ViewControllerInterface
13
{
14
    public const string VIEW_IDENTIFIER = 'SHOW_PADD';
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected T_STRING, expecting '=' on line 14 at column 24
Loading history...
15
16
    #[Override]
17
    public function handle(GameControllerInterface $game): void
18
    {
19
        if ($game->getUser()->getFactionId() === FactionEnum::FACTION_ROMULAN) {
20
            $game->setTemplateFile('html/tutorial/padd2.twig');
21
        } elseif ($game->getUser()->getFactionId() === FactionEnum::FACTION_KLINGON) {
22
            $game->setTemplateFile('html/tutorial/padd3.twig');
23
        } elseif ($game->getUser()->getFactionId() === FactionEnum::FACTION_CARDASSIAN) {
24
            $game->setTemplateFile('html/tutorial/padd4.twig');
25
        } else {
26
            $game->setTemplateFile('html/tutorial/padd1.twig');
27
        }
28
    }
29
}
30