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

SwitchView   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 15
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A performSessionCheck() 0 3 1
A handle() 0 6 1
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