ParsedCommand::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
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace Nkey\Caribu\Console;
3
4
/**
5
 * This class is part of Caribu command line interface framework
6
 *
7
 * @author Maik Greubel <[email protected]>
8
 */
9
class ParsedCommand
10
{
11
12
    /**
13
     * The command
14
     *
15
     * @var string
16
     */
17
    private $command;
18
19
    /**
20
     * List of arguments
21
     *
22
     * @var string[]
23
     */
24
    private $args;
25
26
    /**
27
     * Create a new parsed command instance
28
     *
29
     * @param string $command
30
     *            The command
31
     * @param array $args
32
     *            Optional arguments
33
     */
34 4
    public function __construct(string $command, array $args = array())
35
    {
36 4
        $this->command = $command;
37 4
        $this->args = $args;
38 4
    }
39
40
    /**
41
     * Retrieve the parsed command
42
     *
43
     * @return string
44
     */
45 4
    public function getCommand(): string
46
    {
47 4
        return $this->command;
48
    }
49
50
    /**
51
     * Retrieve list of arguments
52
     *
53
     * @return string[]
54
     */
55 3
    public function getArguments(): array
56
    {
57 3
        return $this->args;
58
    }
59
}
60