DigraphStyle   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 35
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A methods() 0 3 1
A default() 0 3 1
A theme() 0 3 1
A withoutEmptyBlocks() 0 3 1
A properties() 0 3 1
A __construct() 0 6 1
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
The property theme is declared read-only in PhUml\Graphviz\Styles\DigraphStyle.
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