CommandArgument   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A toArray() 0 8 1
1
<?php
2
3
4
namespace SmartWeb\ModuleTesting\Console;
5
6
/**
7
 * Class CommandArgument
8
 *
9
 * @package SmartWeb\ModuleTesting\Console
10
 */
11
class CommandArgument implements CommandArgumentInterface
12
{
13
    
14
    /**
15
     * @var string
16
     */
17
    protected $name;
18
    
19
    /**
20
     * @var InputArgumentType
21
     */
22
    protected $type;
23
    
24
    /**
25
     * @var string
26
     */
27
    protected $description;
28
    
29
    /**
30
     * CommandArgument constructor.
31
     *
32
     * @param string            $name
33
     * @param InputArgumentType $type
34
     * @param string            $description
35
     */
36
    public function __construct(string $name, InputArgumentType $type, string $description)
37
    {
38
        $this->name = $name;
39
        $this->type = $type;
40
        $this->description = $description;
41
    }
42
    
43
    /**
44
     * @return array
45
     */
46
    public function toArray()
47
    {
48
        return [
49
            $this->name,
50
            $this->type->value(),
51
            $this->description,
52
        ];
53
    }
54
    
55
}
56