Passed
Push — master ( f544cb...b3a3d9 )
by Nico
36:43 queued 09:10
created

ShowNewSandbox::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
ccs 0
cts 5
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Module\Admin\View\Sandbox;
6
7
use Stu\Module\Control\GameControllerInterface;
8
use Stu\Module\Control\ViewControllerInterface;
9
10
final class ShowNewSandbox implements ViewControllerInterface
11
{
12
    public const VIEW_IDENTIFIER = 'SHOW_NEW_SANDBOX';
13
14
    public function handle(GameControllerInterface $game): void
15
    {
16
        $game->setPageTitle(_('Neue Sandbox erstellen'));
17
        $game->setMacroInAjaxWindow('html/admin/sandbox/newSandbox.twig');
18
19
        $game->setTemplateVar('SANDBOX_LIST', $game->getUser()->getColonies()->toArray());
20
        $game->setTemplateVar('SANDBOX_NAME', sprintf('SANDBOX %s', date('d M Y')));
21
    }
22
}
23