Completed
Pull Request — master (#6)
by James Ekow Abaka
20:00 queued 18:35
created

Command   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 42.86%

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 3
cts 7
cp 0.4286
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
run() 0 1 ?
A setOptions() 0 4 1
A reverse() 0 6 2
1
<?php
2
3
namespace yentu\commands;
4
5
abstract class Command
6
{
7
    protected $options;
8
9
    abstract public function run();
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
10
11 27
    public function setOptions(array $options)
12
    {
13 27
        $this->options = $options;
14 27
    }
15
16
    public function reverse()
17
    {
18
        if ($this instanceof Reversible) {
19
            $this->reverseActions();
0 ignored issues
show
Bug introduced by
The method reverseActions() does not exist on yentu\commands\Command. Did you maybe mean reverse()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
20
        }
21
    }
22
}
23