Test Failed
Pull Request — master (#226)
by Rustam
12:31
created

Template::getViewContext()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\View;
6
7
final class Template
8
{
9
    /**
10
     * @param string $template The template file.
11
     * @param array $parameters The parameters to be passed to the view file.
12
     * @param ViewInterface $view The view instance used for rendering the file.
13
     * @param ViewContextInterface|null $viewContext The context instance of the view.
14
     */
15
    public function __construct(
16
        private string $template,
17
        private array $parameters,
18
        private ViewInterface $view,
19
        private ?ViewContextInterface $viewContext = null
20
    ) {
21
    }
22
23
    public function getTemplate(): string
24
    {
25
        return $this->template;
26
    }
27
28
    public function getParameters(): array
29
    {
30
        return $this->parameters;
31
    }
32
33
    public function getView(): ViewInterface
34
    {
35
        return $this->view;
36
    }
37
38
    public function getViewContext(): ?ViewContextInterface
39
    {
40
        return $this->viewContext;
41
    }
42
}
43