PrettyPrint::performAction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Swaggest\JsonCli;
4
5
use Yaoi\Command;
6
use Yaoi\Command\Definition;
7
8
class PrettyPrint extends Base
9
{
10
    public $path;
11
    public $pretty = true;
12
13
    /**
14
     * @param Definition $definition
15
     * @param \stdClass|static $options
16
     */
17 1
    static function setUpDefinition(Definition $definition, $options)
18
    {
19 1
        $options->path = Command\Option::create()->setIsUnnamed()->setIsRequired()
20 1
            ->setDescription('Path to .json/.yaml/.yml/.serialized file');
21 1
        parent::setUpDefinition($definition, $options);
22 1
        $definition->description = 'Pretty print/convert document';
23 1
        unset($options->pretty);
24 1
    }
25
26 1
    public function performAction()
27
    {
28 1
        $this->out = $this->readData($this->path);
29 1
        $this->postPerform();
30 1
    }
31
32
}