Summary   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 31
ccs 9
cts 12
cp 0.75
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A output() 0 15 3
A summarize() 0 5 1
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