AbstractEvent::getCommandName()   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 1
Bugs 0 Features 0
Metric Value
c 1
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 Innmind\ProvisionerBundle\Event;
4
5
use Symfony\Component\EventDispatcher\Event;
6
use Symfony\Component\Console\Input\InputInterface;
7
8
abstract class AbstractEvent extends Event
9
{
10
    protected $commandName;
11
    protected $input;
12
13
    /**
14
     * Construct an event for the given command
15
     * @param string $name Command name
16
     * @param InputInterface $input Command input
17
     */
18 33
    public function __construct($name, InputInterface $input)
19
    {
20 33
        $this->commandName = (string) $name;
21 33
        $this->input = $input;
22 33
    }
23
24
    /**
25
     * Return the command name
26
     *
27
     * @return string
28
     */
29 24
    public function getCommandName()
30
    {
31 24
        return $this->commandName;
32
    }
33
34
    /**
35
     * Return the command input
36
     *
37
     * @return InputInterface
38
     */
39 21
    public function getCommandInput()
40
    {
41 21
        return $this->input;
42
    }
43
}
44