Passed
Push — master ( bf860f...1dd8f7 )
by Nico
57:55 queued 29:36
created

SwitchView::performSessionCheck()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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