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

ShowInnerContent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 1
A __construct() 0 4 1
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