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

ProgressDisplay::__construct()   A

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 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
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\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