1 | <?php |
||
5 | final class Theme |
||
6 | { |
||
7 | private $dir; |
||
8 | private $name; |
||
9 | /** @var ?Theme */ |
||
10 | private $next; |
||
11 | |||
12 | private function __construct(string $dir, string $name) { |
||
16 | |||
17 | /** @param Theme[] $themes */ |
||
18 | public static function hierarchy(array $themes): Theme { |
||
30 | |||
31 | public static function new(string $dir, string $name = 'Default'): self { |
||
34 | |||
35 | public function dir(): string { |
||
38 | |||
39 | public function name(): string { |
||
42 | |||
43 | /** |
||
44 | * list all directories in the hierarchy from first to last |
||
45 | * @return Theme[] |
||
46 | */ |
||
47 | public function listThemeHierarchy(): \Generator { |
||
53 | |||
54 | /** @param Theme[] $themes */ |
||
55 | private static function assertThemesForHierarchyAreNotEmpty(array $themes) { |
||
60 | |||
61 | /** @param Theme[] $themes */ |
||
62 | private static function assertAllThemesInHierarchyAreLeafThemes(array $themes) { |
||
69 | |||
70 | private static function assertHierarchyContainsUniqueThemeNames(Theme $theme) { |
||
80 | } |
||
81 |