Total Complexity | 5 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
16 | final class GraphvizConfiguration |
||
17 | { |
||
18 | private AssociationsBuilder $associationsBuilder; |
||
19 | |||
20 | private DigraphStyle $digraphStyle; |
||
21 | |||
22 | /** @param mixed[] $configuration */ |
||
23 | public function __construct(array $configuration) |
||
24 | { |
||
25 | $extractAssociations = (bool) ($configuration['associations'] ?? false); |
||
26 | $this->associationsBuilder = $extractAssociations ? new EdgesBuilder() : new NoAssociationsBuilder(); |
||
27 | $theme = new ThemeName($configuration['theme']); |
||
28 | $hideEmptyBlocks = (bool) ($configuration['hide-empty-blocks'] ?? false); |
||
29 | $this->digraphStyle = $hideEmptyBlocks |
||
30 | ? DigraphStyle::withoutEmptyBlocks($theme) |
||
31 | : DigraphStyle::default($theme); |
||
32 | } |
||
33 | |||
34 | public function associationsBuilder(): AssociationsBuilder |
||
37 | } |
||
38 | |||
39 | public function digraphStyle(): DigraphStyle |
||
44 |