ParsedCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 51
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCommand() 0 4 1
A getArguments() 0 4 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