Total Complexity | 6 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
13 | final class DigraphStyle |
||
14 | { |
||
15 | private readonly string $theme; |
||
|
|||
16 | |||
17 | 29 | public static function default(ThemeName $theme): DigraphStyle |
|
18 | { |
||
19 | 29 | return new DigraphStyle($theme, 'partials/_properties.html.twig', 'partials/_methods.html.twig'); |
|
20 | } |
||
21 | |||
22 | 3 | public static function withoutEmptyBlocks(ThemeName $theme): DigraphStyle |
|
23 | { |
||
24 | 3 | return new DigraphStyle($theme, 'partials/_empty-properties.html.twig', 'partials/_empty-methods.html.twig'); |
|
25 | } |
||
26 | |||
27 | 32 | private function __construct( |
|
28 | ThemeName $theme, |
||
29 | private readonly string $properties, |
||
30 | private readonly string $methods |
||
31 | ) { |
||
32 | 32 | $this->theme = "{$theme->name()}.html.twig"; |
|
33 | } |
||
34 | |||
35 | 23 | public function properties(): string |
|
36 | { |
||
37 | 23 | return $this->properties; |
|
38 | } |
||
39 | |||
40 | 23 | public function methods(): string |
|
41 | { |
||
42 | 23 | return $this->methods; |
|
43 | } |
||
44 | |||
45 | 26 | public function theme(): string |
|
50 |