Completed
Push — master ( 9d1ab7...13f027 )
by Luis
04:13 queued 02:19
created

DigraphGenerator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A generateDigraph() 0 4 1
1
<?php
2
/**
3
 * PHP version 7.1
4
 *
5
 * This source file is subject to the license that is bundled with this package in the file LICENSE.
6
 */
7
8
namespace PhUml\Generators;
9
10
use PhUml\Code\Structure;
11
use PhUml\Parser\CodeParser;
12
use PhUml\Processors\GraphvizProcessor;
13
14
class DigraphGenerator extends Generator
15
{
16
    /** @var GraphvizProcessor */
17
    protected $digraphProcessor;
18
19 51
    public function __construct(CodeParser $parser, GraphvizProcessor $digraphProcessor)
20
    {
21 51
        parent::__construct($parser);
22 51
        $this->digraphProcessor = $digraphProcessor;
23 51
    }
24
25 39
    protected function generateDigraph(Structure $structure): string
26
    {
27 39
        $this->display()->runningProcessor($this->digraphProcessor);
28 39
        return $this->digraphProcessor->process($structure);
29
    }
30
}
31