Summary::output()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 15
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 9
cts 9
cp 1
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 6
nc 4
nop 0
crap 3
1
<?php
2
3
namespace Buttress\Concrete\Console\Command\Argument;
4
5
class Summary extends \League\CLImate\Argument\Summary
6
{
7
8
    /**
9
     * Output the full summary for the program
10
     */
11 3
    public function output()
12
    {
13
14 3
        if ($this->description) {
15 3
            $this->climate->out($this->description)->br();
16 2
        }
17
18
        // Print the usage statement with the arguments without a prefix at the end.
19 3
        $this->climate->out($this->summarize());
20
21
        // Print argument details.
22 3
        foreach (['required', 'optional'] as $type) {
23 3
            $this->outputArguments($this->filter->{$type}(), $type);
24 2
        }
25 3
    }
26
27
    /**
28
     * Output the short summary
29
     */
30
    public function summarize()
31
    {
32
        return "<yellow>Usage</yellow>: <dim>c5</dim> <bold>{$this->command}</bold> <dim>"
33
            . $this->short($this->getOrderedArguments()) . '</dim>';
34
    }
35
}
36