Passed
Pull Request — master (#1699)
by Nico
43:19 queued 18:45
created

SwitchView::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
ccs 4
cts 4
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\Game\Action\SwitchView;
6
7
use request;
8
use Stu\Component\Game\ModuleViewEnum;
9
use Stu\Module\Control\ActionControllerInterface;
10
use Stu\Module\Control\GameControllerInterface;
11
use Stu\Module\Game\View\ShowInnerContent\ShowInnerContent;
12
13
final class SwitchView implements ActionControllerInterface
14
{
15
    public const ACTION_IDENTIFIER = 'B_SWITCH_VIEW';
16
17 3
    public function handle(GameControllerInterface $game): void
18
    {
19 3
        $game->setView(
20 3
            ShowInnerContent::VIEW_IDENTIFIER,
21 3
            ['VIEW' => ModuleViewEnum::from(request::getStringFatal('view'))]
22 3
        );
23
    }
24
25
    public function performSessionCheck(): bool
26
    {
27
        return false;
28
    }
29
}
30