Conditions | 6 |
Paths | 10 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
32 | 11 | public function setLayouts(array $usedLayouts = []): static |
|
33 | { |
||
34 | 11 | $this->layouts = []; |
|
35 | |||
36 | 11 | foreach ($usedLayouts as $key => $layout) { |
|
37 | 11 | if (is_a($layout, Layout::class, true)) { |
|
38 | 11 | if (is_string($layout)) { |
|
39 | 11 | $layout = new $layout; |
|
40 | } |
||
41 | 11 | $this->layouts[(is_numeric($key) || !$key) ? $layout->name() : $key] = $layout::class; |
|
42 | } |
||
43 | } |
||
44 | |||
45 | 11 | return $this; |
|
46 | } |
||
62 |