Command::getArguments()   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

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Wandu\Console;
3
4
use Symfony\Component\Console\Input\InputInterface;
5
use Symfony\Component\Console\Output\OutputInterface;
6
7
abstract class Command
8
{
9
    /** @var \Symfony\Component\Console\Input\InputInterface */
10
    protected $input;
11
12
    /** @var \Symfony\Component\Console\Output\OutputInterface */
13
    protected $output;
14
15
    /** @var string */
16
    protected $description = '';
17
    
18
    /** @var string */
19
    protected $help = '';
20
    
21
    /** @var array */
22
    protected $arguments = [];
23
    
24
    /** @var array */
25
    protected $options = [];
26
    
27
    /**
28
     * @param \Symfony\Component\Console\Input\InputInterface $input
29
     * @param \Symfony\Component\Console\Output\OutputInterface $output
30
     * @return \Wandu\Console\Command
31
     */
32
    public function withIO(InputInterface $input, OutputInterface $output)
33
    {
34
        $new = clone $this;
35
        $new->input = $input;
36
        $new->output = $output;
37
        return $new;
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function getDescription()
44
    {
45
        return $this->description;
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function getHelp()
52
    {
53
        return $this->help;
54
    }
55
56
    /**
57
     * @return array
58
     */
59
    public function getArguments()
60
    {
61
        return $this->arguments;
62
    }
63
64
    /**
65
     * @return array
66
     */
67
    public function getOptions()
68
    {
69
        return $this->options;
70
    }
71
    
72
    abstract function execute();
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
73
}
74