Command   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 67
ccs 0
cts 23
cp 0
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A withIO() 0 7 1
A getDescription() 0 4 1
A getHelp() 0 4 1
A getArguments() 0 4 1
A getOptions() 0 4 1
execute() 0 1 ?
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