Passed
Push — dev ( 915030...7801e0 )
by Janko
23:47 queued 09:25
created

UplinkFallbackHandler::handle()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 5
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 8
ccs 0
cts 5
cp 0
crap 12
rs 10
1
<?php
2
3
namespace Stu\Module\Control\Router\Handler;
4
5
use request;
6
use Stu\Module\Control\GameControllerInterface;
7
use Stu\Module\Control\Router\FallbackRouteException;
8
9
class UplinkFallbackHandler implements FallbackHandlerInterface
10
{
11
    public function handle(FallbackRouteException $e, GameControllerInterface $game): void
12
    {
13
        $game->addInformation('Diese Aktion ist per Uplink nicht möglich!');
14
15
        if (request::isAjaxRequest() && !request::has('switch')) {
16
            $game->setMacroInAjaxWindow('html/systeminformation.twig');
17
        } else {
18
            $game->setViewTemplate('html/empty.twig');
19
        }
20
    }
21
}
22