Completed
Push — master ( 797142...deecf0 )
by Luis
06:15 queued 02:52
created

ProgressDisplay   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 23
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A savingResult() 0 3 1
A __construct() 0 3 1
A runningParser() 0 3 1
A runningProcessor() 0 3 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\Console;
9
10
use PhUml\Actions\CanExecuteAction;
11
use PhUml\Processors\Processor;
12
use Symfony\Component\Console\Output\OutputInterface;
13
use Symfony\Component\Console\Output\StreamOutput;
14
15
class ProgressDisplay implements CanExecuteAction
16
{
17
    /** @var OutputInterface */
18
    private $output;
19
20 36
    public function __construct(OutputInterface $output = null)
21
    {
22 36
        $this->output = $output ?? new StreamOutput(fopen('php://memory', 'w', false));
0 ignored issues
show
Bug introduced by
It seems like fopen('php://memory', 'w', false) can also be of type false; however, parameter $stream of Symfony\Component\Consol...amOutput::__construct() does only seem to accept resource, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

22
        $this->output = $output ?? new StreamOutput(/** @scrutinizer ignore-type */ fopen('php://memory', 'w', false));
Loading history...
23 36
    }
24
25 15
    public function runningParser(): void
26
    {
27 15
        $this->output->writeln('[|] Parsing class structure');
28 15
    }
29
30 15
    public function runningProcessor(Processor $processor): void
31
    {
32 15
        $this->output->writeln("[|] Running '{$processor->name()}' processor");
33 15
    }
34
35 15
    public function savingResult(): void
36
    {
37 15
        $this->output->writeln('[|] Writing generated data to disk');
38 15
    }
39
}
40