| Total Complexity | 9 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class WebTemplateBucket extends DataBucket |
||
| 8 | { |
||
| 9 | private ?string $template = null; |
||
| 10 | private ?string $layout = null; |
||
| 11 | private iterable $layoutData = []; |
||
| 12 | private iterable $commonData = []; |
||
| 13 | |||
| 14 | 12 | public function __construct(iterable $templateData, string $format = null, array $params = []) |
|
| 15 | { |
||
| 16 | 12 | parent::__construct($templateData, $format, $params); |
|
| 17 | 12 | } |
|
| 18 | 2 | public function getTemplate(): ?string |
|
| 21 | } |
||
| 22 | 2 | public function getCommonData(): iterable |
|
| 23 | { |
||
| 24 | 2 | return $this->commonData; |
|
| 25 | } |
||
| 26 | 2 | public function getLayout(): ?string |
|
| 27 | { |
||
| 28 | 2 | return $this->layout; |
|
| 29 | } |
||
| 30 | 1 | public function getLayoutData(): iterable |
|
| 31 | { |
||
| 32 | 1 | return $this->layoutData; |
|
| 33 | } |
||
| 34 | 1 | public function getTemplateData(): iterable |
|
| 35 | { |
||
| 36 | 1 | return $this->data; |
|
| 37 | } |
||
| 38 | |||
| 39 | 1 | public function withLayout(string $layout, iterable $layoutData = []): self |
|
| 40 | { |
||
| 41 | 1 | $new = clone $this; |
|
| 42 | 1 | $new->layout = $layout; |
|
| 43 | 1 | $new->layoutData = $layoutData; |
|
| 44 | 1 | return $new; |
|
| 45 | } |
||
| 46 | 1 | public function withTemplate(string $template): self |
|
| 47 | { |
||
| 48 | 1 | $new = clone $this; |
|
| 49 | 1 | $new->template = $template; |
|
| 50 | 1 | return $new; |
|
| 51 | } |
||
| 52 | 1 | public function withCommonData(iterable $defaultData): self |
|
| 57 | } |
||
| 58 | } |
||
| 59 |