Passed
Pull Request — master (#1699)
by Nico
43:19 queued 18:45
created

ShowInnerContent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Module\Game\View\ShowInnerContent;
6
7
use Stu\Component\Game\ModuleViewEnum;
8
use Stu\Module\Control\GameControllerInterface;
9
use Stu\Module\Control\ViewControllerInterface;
10
use Stu\Module\Game\Lib\View\ViewComponentLoaderInterface;
11
12
final class ShowInnerContent implements ViewControllerInterface
13
{
14
    public const VIEW_IDENTIFIER = 'SHOW_INNER_CONTENT';
15
16
    private ViewComponentLoaderInterface $viewComponentLoader;
17
18
    public function __construct(
19
        ViewComponentLoaderInterface $viewComponentLoader
20
    ) {
21
        $this->viewComponentLoader = $viewComponentLoader;
22
    }
23
24
    public function handle(GameControllerInterface $game): void
25
    {
26
        /** @var ModuleViewEnum  */
27
        $view = $game->getViewContext()['VIEW'];
28
29
        $this->viewComponentLoader->registerViewComponents($view, $game);
30
        $game->setTemplateVar('VIEW_TEMPLATE', $view->getTemplate());
31
32
        $game->showMacro('html/view/breadcrumbAndView.twig');
33
    }
34
}
35