Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
11 / 11
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
Layout
100.00% covered (success)
100.00%
11 / 11
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
11 / 11
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2namespace Apie\HtmlBuilders\Components;
3
4use Apie\HtmlBuilders\Components\Layout\Menu;
5use Apie\HtmlBuilders\Components\Layout\TopBar;
6use Apie\HtmlBuilders\Configuration\CurrentConfiguration;
7use Apie\HtmlBuilders\Interfaces\ComponentInterface;
8use Apie\HtmlBuilders\Lists\ComponentHashmap;
9
10class Layout extends BaseComponent
11{
12    public function __construct(
13        string $pageTitle,
14        CurrentConfiguration $currentConfiguration,
15        ComponentInterface $contents,
16        ?ComponentInterface $menu = null,
17    ) {
18        parent::__construct(
19            [
20                'title' => $currentConfiguration->getBrowserTitle($pageTitle),
21            ],
22            new ComponentHashmap([
23                'top' => new TopBar($currentConfiguration),
24                'menu' => $menu ?? new Menu($currentConfiguration),
25                'legacy' => new Menu($currentConfiguration),
26                'content' => $contents,
27            ])
28        );
29    }
30}