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

UserLockedFallbackHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

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