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

Rearrange::performAction()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
c 0
b 0
f 0
rs 9.4285
cc 2
eloc 5
nc 2
nop 0
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
}