Passed
Push — master ( 2b0e69...0701c6 )
by Luis
39s queued 11s
created

ProgressDisplay::runningProcessor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 1
cts 1
cp 1
crap 1
rs 10
c 2
b 0
f 0
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\Console;
9
10
use PhUml\Generators\ProcessorProgressDisplay;
11
use PhUml\Processors\Processor;
12
use Symfony\Component\Console\Output\OutputInterface;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Console\Output\OutputInterface 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...
13
14
/**
15
 * It provides visual feedback to the use about the progress of the current command
16
 *
17
 * @see ProcessorProgressDisplay for more details about the things that are reported by this display
18
 */
19
class ProgressDisplay implements ProcessorProgressDisplay
20
{
21
    /** @var OutputInterface */
22
    private $output;
23
24
    public function __construct(OutputInterface $output)
25 72
    {
26
        $this->output = $output;
27 72
    }
28 72
29
    public function start(): void
30 30
    {
31
        $this->display('Running... (This may take some time)');
32 30
    }
33 30
34
    public function runningParser(): void
35 30
    {
36
        $this->display('Parsing codebase structure');
37 30
    }
38 30
39
    public function runningProcessor(Processor $processor): void
40 30
    {
41
        $this->display("Running '{$processor->name()}' processor");
42 30
    }
43 30
44
    public function savingResult(): void
45 30
    {
46
        $this->display('Writing generated data to disk');
47 30
    }
48 30
49
    private function display(string $message): void
50 30
    {
51
        $this->output->writeln("<info>[|]</info> $message");
52 30
    }
53
}
54