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

UplinkFallbackHandler   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 10
ccs 0
cts 5
cp 0
rs 10
wmc 3

1 Method

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