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

DescriptiveCompletion::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
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