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

DigraphPrinter::toDot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
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