Passed
Push — master ( 7ad944...9954d6 )
by Viacheslav
02:21
created

Rearrange   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 19
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUpDefinition() 0 4 1
A performAction() 0 10 2
1
<?php
2
3
namespace Swaggest\JsonDiff\Cli;
4
5
6
use Yaoi\Command;
7
8
class Rearrange extends Base
9
{
10
    static function setUpDefinition(Command\Definition $definition, $options)
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...
11
    {
12
        parent::setUpDefinition($definition, $options);
13
        $definition->description = 'Rearrange json document in the order of another (original) json document';
14
    }
15
16
17
    public function performAction()
18
    {
19
        $this->prePerform();
20
        if (null === $this->diff) {
21
            return;
22
        }
23
24
        $this->out = $this->diff->getRearranged();
25
26
        $this->postPerform();
27
    }
28
29
}