Layout   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 25
ccs 6
cts 6
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A body() 0 3 1
A templateContext() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Conia\Boiler;
6
7
class Layout extends Template
8
{
9
    /**
10
     * @psalm-param non-empty-string $path
11
     */
12 8
    public function __construct(
13
        string $path,
14
        protected readonly string $body,
15
        Sections $sections,
16
        ?Engine $engine = null,
17
    ) {
18 8
        parent::__construct($path, $sections, $engine);
19
    }
20
21
    /**
22
     * Used in the layout template to get the content of the wrapped template.
23
     */
24 6
    public function body(): string
25
    {
26 6
        return $this->body;
27
    }
28
29 8
    protected function templateContext(array $context, array $whitelist, bool $autoescape): LayoutContext
30
    {
31 8
        return new LayoutContext($this, $context, $whitelist, $autoescape);
32
    }
33
}
34