Completed
Pull Request — master (#90)
by
unknown
01:29
created

DescriptiveCompletion   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 8 2
1
<?php
2
3
namespace Stecman\Component\Symfony\Console\BashCompletion\Completion;
4
5
use Stecman\Component\Symfony\Console\BashCompletion\Completion;
6
7
/**
8
 * A completion that allows zsh-compatible descriptions
9
 */
10
class DescriptiveCompletion extends Completion
11
{
12
    /**
13
     * Return the stored completion, or the results returned from the completion callback
14
     *
15
     * @return \Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionResultInterface
16
     */
17
    public function run()
18
    {
19
        if ($this->isCallable()) {
20
            return new CompletionResult(call_user_func($this->completion), true);
21
        }
22
23
        return new CompletionResult($this->completion, true);
24
    }
25
}
26