Test Failed
Pull Request — master (#231)
by Rustam
02:47
created

Template::getParameters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 1
c 2
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
/**
8
 * The template holds the information needed to render a view.
9
 */
10
final class Template
11
{
12
    /**
13
     * @param string $path The full absolute path of the view template file.
14
     * @param array $parameters The parameters to pass to the template.
15
     * @param ViewInterface $view The view instance used for rendering the file.
16
     * @param ViewContextInterface|null $viewContext The context instance of the view.
17
     */
18
    public function __construct(
19
        private string $path,
20
        private array $parameters,
21
        private ViewInterface $view,
22
        private ?ViewContextInterface $viewContext = null
23
    ) {
24
    }
25
26
    public function getTemplate(): string
27
    {
28
        return $this->path;
29
    }
30
31
    public function getParameters(): array
32
    {
33
        return $this->parameters;
34
    }
35
36
    public function getView(): ViewInterface
37
    {
38
        return $this->view;
39
    }
40
41
    public function getViewContext(): ?ViewContextInterface
42
    {
43
        return $this->viewContext;
44
    }
45
}
46