PrettyPrint   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 22
ccs 10
cts 10
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A performAction() 0 4 1
A setUpDefinition() 0 7 1
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
}