Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
Layout
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 body
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 context
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Celemas\Boiler;
6
7use Override;
8
9/** @internal */
10final class Layout extends BaseTemplate
11{
12    /**
13     * @param non-empty-string $path
14     */
15    public function __construct(
16        string $path,
17        private readonly string $body,
18        Sections $sections,
19        Engine $engine,
20    ) {
21        parent::__construct($path, $sections, $engine);
22    }
23
24    /**
25     * Used in the layout template to get the content of the wrapped template.
26     */
27    public function body(): string
28    {
29        return $this->body;
30    }
31
32    #[Override]
33    protected function context(array $context, array $trusted, bool $autoescape): Context
34    {
35        return new LayoutContext($this, $context, $trusted, $autoescape);
36    }
37}