Completed
Push — dot-language-processor ( 82cdb7...13d982 )
by Luis
14:10
created

ProgressDisplay::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
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
    public function __construct(OutputInterface $output = null)
21
    {
22
        $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
    }
24
25
    public function runningParser(): void
26
    {
27
        $this->output->writeln('[|] Parsing class structure');
28
    }
29
30
    public function runningProcessor(Processor $processor): void
31
    {
32
        $this->output->writeln("[|] Running '{$processor->name()}' processor");
33
    }
34
35
    public function savingResult(): void
36
    {
37
        $this->output->writeln('[|] Writing generated data to disk');
38
    }
39
}
40