ConsoleEvent::getCommand()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
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 3
    public function __construct(
28
        string $command,
29
        OutputInterface $output = null
30
    ) {
31 3
        parent::__construct(self::NAME);
32
33 3
        $this->command = $command;
34 3
        $this->output  = $output;
35 3
    }
36
37
    /**
38
     * @return string
39
     */
40 3
    public function getCommand() : string
41
    {
42 3
        return $this->command;
43
    }
44
45
    /**
46
     * @return OutputInterface|null
47
     */
48 3
    public function getOutput()
49
    {
50 3
        return $this->output;
51
    }
52
}
53