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

SwitchView   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 15
ccs 5
cts 7
cp 0.7143
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 5 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\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