Passed
Pull Request — master (#30)
by
unknown
46:28 queued 21:27
created

DigraphPrinter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 11
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A toDot() 0 5 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;
7
8
use PhUml\Graphviz\Styles\DigraphStyle;
9
use PhUml\Templates\TemplateEngine;
10
11
final class DigraphPrinter
12
{
13 32
    public function __construct(private readonly TemplateEngine $engine, private readonly DigraphStyle $style)
14
    {
15
    }
16
17 27
    public function toDot(Digraph $digraph): string
18
    {
19 27
        return trim($this->engine->render('digraph.html.twig', [
20
            'digraph' => $digraph,
21 27
            'style' => $this->style,
22
        ]));
23
    }
24
}
25