DigraphConfiguration::codeParser()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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\Generators;
7
8
use PhUml\Parser\CodeFinder;
9
use PhUml\Parser\CodeFinderConfiguration;
10
use PhUml\Parser\CodeParser;
11
use PhUml\Parser\CodeParserConfiguration;
12
use PhUml\Parser\SourceCodeFinder;
13
use PhUml\Processors\GraphvizConfiguration;
14
use PhUml\Processors\GraphvizProcessor;
15
use PhUml\Processors\OutputWriter;
16
use PhUml\Stages\ProgressDisplay;
17
use Symplify\SmartFileSystem\SmartFileSystem;
0 ignored issues
show
Bug introduced by
The type Symplify\SmartFileSystem\SmartFileSystem was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
18
19
final class DigraphConfiguration
20
{
21
    private readonly CodeFinder $codeFinder;
22
23
    private readonly CodeParser $codeParser;
24
25
    private readonly GraphvizProcessor $graphvizProcessor;
26
27
    private readonly OutputWriter $writer;
28
29
    /**
30
     * @param array{
31
     *     recursive: bool,
32
     *     associations: bool,
33
     *     "hide-private": bool,
34
     *     "hide-protected": bool,
35
     *     "hide-methods": bool,
36
     *     "hide-attributes": bool,
37
     *     "hide-empty-blocks": bool,
38
     *     theme: string
39
     *  } $options
40
     */
41 5
    public function __construct(array $options, private readonly ProgressDisplay $display)
42
    {
43 5
        $this->codeFinder = SourceCodeFinder::fromConfiguration(new CodeFinderConfiguration($options));
0 ignored issues
show
Bug introduced by
The property codeFinder is declared read-only in PhUml\Generators\DigraphConfiguration.
Loading history...
44 5
        $this->codeParser = CodeParser::fromConfiguration(new CodeParserConfiguration($options));
0 ignored issues
show
Bug introduced by
The property codeParser is declared read-only in PhUml\Generators\DigraphConfiguration.
Loading history...
45 5
        $this->graphvizProcessor = GraphvizProcessor::fromConfiguration(new GraphvizConfiguration($options));
0 ignored issues
show
Bug introduced by
The property graphvizProcessor is declared read-only in PhUml\Generators\DigraphConfiguration.
Loading history...
46 5
        $this->writer = new OutputWriter(new SmartFileSystem());
0 ignored issues
show
Bug introduced by
The property writer is declared read-only in PhUml\Generators\DigraphConfiguration.
Loading history...
47
    }
48
49 5
    public function codeFinder(): CodeFinder
50
    {
51 5
        return $this->codeFinder;
52
    }
53
54 4
    public function codeParser(): CodeParser
55
    {
56 4
        return $this->codeParser;
57
    }
58
59 4
    public function graphvizProcessor(): GraphvizProcessor
60
    {
61 4
        return $this->graphvizProcessor;
62
    }
63
64 4
    public function writer(): OutputWriter
65
    {
66 4
        return $this->writer;
67
    }
68
69 4
    public function display(): ProgressDisplay
70
    {
71 4
        return $this->display;
72
    }
73
}
74