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

UserLockedFallbackHandler::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 7
ccs 0
cts 5
cp 0
crap 6
rs 10
1
<?php
2
3
namespace Stu\Module\Control\Router\Handler;
4
5
use Stu\Lib\UserLockedException;
6
use Stu\Module\Control\GameControllerInterface;
7
use Stu\Module\Control\Router\FallbackRouteException;
8
9
class UserLockedFallbackHandler implements FallbackHandlerInterface
10
{
11
    public function handle(FallbackRouteException $e, GameControllerInterface $game): void
12
    {
13
        $game->setTemplateFile('html/index/accountLocked.twig');
14
        $game->setTemplateVar('LOGIN_ERROR', $e->getMessage());
15
16
        if ($e instanceof UserLockedException) {
17
            $game->setTemplateVar('REASON', $e->getDetails());
18
        }
19
    }
20
}
21