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

ShowPadd::handle()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 20

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 4
eloc 8
c 3
b 0
f 0
nc 4
nop 1
dl 0
loc 10
ccs 0
cts 8
cp 0
crap 20
rs 10
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