BaseCommand::getDescription()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace LWI\DeliveryTracking\Command;
4
5
use League\CLImate\CLImate;
6
7
/**
8
 * Class BaseCommand
9
 */
10
abstract class BaseCommand
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $name;
16
17
    /**
18
     * @var string
19
     */
20
    protected $description;
21
22
    /**
23
     * @var array
24
     */
25
    protected $argumentsDefinition = [];
26
27
    /**
28
     * @param string $name
29
     * @return $this
30
     */
31
    protected function setName($name)
32
    {
33
        $this->name = $name;
34
35
        return $this;
36
    }
37
38
    /**
39
     * @param string $description
40
     * @return $this
41
     */
42
    protected function setDescription($description)
43
    {
44
        $this->description = $description;
45
46
        return $this;
47
    }
48
49
    /**
50
     * @param array $argumentsDefinition
51
     * @return $this
52
     */
53
    public function setArgumentsDefinition($argumentsDefinition)
54
    {
55
        $this->argumentsDefinition = $argumentsDefinition;
56
57
        return $this;
58
    }
59
60
    /**
61
     * @return void
62
     */
63
    abstract public function configure();
64
65
    /**
66
     * @param CLImate $cli
67
     * @param array $arguments
68
     * @return mixed
69
     */
70
    abstract public function execute(CLImate $cli, $arguments);
71
72
    /**
73
     * @return string
74
     */
75
    public function getName()
76
    {
77
        return $this->name;
78
    }
79
80
    /**
81
     * @return string
82
     */
83
    public function getDescription()
84
    {
85
        return $this->description;
86
    }
87
88
    /**
89
     * @return array
90
     */
91
    public function getArgumentsDefinition()
92
    {
93
        return $this->argumentsDefinition;
94
    }
95
}
96