| Total Complexity | 10 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| 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 array $layoutData = []; |
||
| 12 | private array $defaultData = []; |
||
| 13 | |||
| 14 | public function getTemplate(): ?string |
||
| 17 | } |
||
| 18 | public function getDefaultData(): array |
||
| 19 | { |
||
| 20 | return $this->defaultData; |
||
| 21 | } |
||
| 22 | public function getLayout(): ?string |
||
| 23 | { |
||
| 24 | return $this->layout; |
||
| 25 | } |
||
| 26 | public function getLayoutData(): array |
||
| 27 | { |
||
| 28 | return $this->layoutData; |
||
| 29 | } |
||
| 30 | public function getTemplateData(): array |
||
| 33 | } |
||
| 34 | |||
| 35 | public function withLayout(string $layout, array $layoutData = []): self |
||
| 36 | { |
||
| 37 | $clone = clone $this; |
||
| 38 | $clone->layout = $layout; |
||
| 39 | $clone->layoutData = $layoutData; |
||
| 40 | return $clone; |
||
| 41 | } |
||
| 42 | public function withTemplate(string $template): self |
||
| 43 | { |
||
| 44 | $clone = clone $this; |
||
| 45 | $clone->template = $template; |
||
| 46 | return $clone; |
||
| 47 | } |
||
| 48 | public function withAddedTemplateData(string $key, $value): self |
||
| 49 | { |
||
| 50 | $clone = clone $this; |
||
| 51 | $clone->data[$key] = $value; |
||
| 52 | return $clone; |
||
| 53 | } |
||
| 54 | public function withDefaultData(array $defaultData): self |
||
| 59 | } |
||
| 60 | public function withAddedDefaultData(string $key, $value): self |
||
| 61 | { |
||
| 62 | $clone = clone $this; |
||
| 67 |