| Total Complexity | 5 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 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 | 61 | public function __construct( |
|
| 19 | private string $path, |
||
| 20 | private array $parameters, |
||
| 21 | private ViewInterface $view, |
||
| 22 | private ?ViewContextInterface $viewContext = null |
||
| 23 | ) { |
||
| 24 | 61 | } |
|
| 25 | |||
| 26 | /** |
||
| 27 | * Get the full absolute path of the view template file. |
||
| 28 | * |
||
| 29 | * @return string The full absolute path of the view template file. |
||
| 30 | */ |
||
| 31 | 61 | public function getPath(): string |
|
| 32 | { |
||
| 33 | 61 | return $this->path; |
|
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Get the parameters to pass to the template. |
||
| 38 | * |
||
| 39 | * @return array The parameters to pass to the template. |
||
| 40 | */ |
||
| 41 | 61 | public function getParameters(): array |
|
| 42 | { |
||
| 43 | 61 | return $this->parameters; |
|
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Get the view instance used for rendering the file. |
||
| 48 | * |
||
| 49 | * @return ViewInterface The view instance used for rendering the file. |
||
| 50 | */ |
||
| 51 | 61 | public function getView(): ViewInterface |
|
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Get the context instance of the view. |
||
| 58 | * |
||
| 59 | * @return ViewContextInterface|null The context instance of the view. |
||
| 60 | */ |
||
| 61 | 1 | public function getViewContext(): ?ViewContextInterface |
|
| 64 | } |
||
| 65 | } |
||
| 66 |