MontealegreLuis /
phuml
| 1 | <?php declare(strict_types=1); |
||
| 2 | /** |
||
| 3 | * This source file is subject to the license that is bundled with this package in the file LICENSE. |
||
| 4 | */ |
||
| 5 | |||
| 6 | namespace PhUml\Graphviz\Styles; |
||
| 7 | |||
| 8 | /** |
||
| 9 | * It is a container for the partial files used to build the HTML label for the node |
||
| 10 | */ |
||
| 11 | final class DigraphStyle |
||
| 12 | { |
||
| 13 | private readonly string $theme; |
||
| 14 | |||
| 15 | 29 | public static function default(ThemeName $theme): DigraphStyle |
|
| 16 | { |
||
| 17 | 29 | return new DigraphStyle($theme, 'partials/_properties.html.twig', 'partials/_methods.html.twig'); |
|
| 18 | } |
||
| 19 | |||
| 20 | 3 | public static function withoutEmptyBlocks(ThemeName $theme): DigraphStyle |
|
| 21 | { |
||
| 22 | 3 | return new DigraphStyle($theme, 'partials/_empty-properties.html.twig', 'partials/_empty-methods.html.twig'); |
|
| 23 | } |
||
| 24 | |||
| 25 | 32 | private function __construct( |
|
| 26 | ThemeName $theme, |
||
| 27 | private readonly string $properties, |
||
| 28 | private readonly string $methods |
||
| 29 | ) { |
||
| 30 | 32 | $this->theme = "{$theme->name()}.html.twig"; |
|
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 31 | } |
||
| 32 | |||
| 33 | 23 | public function properties(): string |
|
| 34 | { |
||
| 35 | 23 | return $this->properties; |
|
| 36 | } |
||
| 37 | |||
| 38 | 23 | public function methods(): string |
|
| 39 | { |
||
| 40 | 23 | return $this->methods; |
|
| 41 | } |
||
| 42 | |||
| 43 | 26 | public function theme(): string |
|
| 44 | { |
||
| 45 | 26 | return $this->theme; |
|
| 46 | } |
||
| 47 | } |
||
| 48 |