Completed
Push — master ( 5a5b2e...66ec7e )
by Matze
04:12
created

ConsoleEvent::getCommand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace BrainExe\Core\EventDispatcher\Events;
4
5
use BrainExe\Core\EventDispatcher\AbstractEvent;
6
use Symfony\Component\Console\Output\OutputInterface;
7
8
class ConsoleEvent extends AbstractEvent
9
{
10
11
    const NAME = 'console.run';
12
13
    /**
14
     * @var string
15
     */
16
    private $command;
17
18
    /**
19
     * @var OutputInterface
20
     */
21
    private $output;
22
23
    /**
24
     * @param string $command
25
     * @param OutputInterface $output
26
     */
27
    public function __construct(
28
        string $command,
29
        OutputInterface $output = null
30
    ) {
31
        parent::__construct(self::NAME);
32
33
        $this->command = $command;
34
        $this->output  = $output;
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getCommand() : string
41
    {
42
        return $this->command;
43
    }
44
45
    /**
46
     * @return OutputInterface|null
47
     */
48
    public function getOutput()
49
    {
50
        return $this->output;
51
    }
52
}
53