CompletionCommand::configureCompletion()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 12
c 0
b 0
f 0
dl 0
loc 18
ccs 0
cts 15
cp 0
rs 9.8666
cc 1
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * This file is part of the SVN-Buddy library.
4
 * For the full copyright and license information, please view
5
 * the LICENSE file that was distributed with this source code.
6
 *
7
 * @copyright Alexander Obuhovich <[email protected]>
8
 * @link      https://github.com/console-helpers/svn-buddy
9
 */
10
11
namespace ConsoleHelpers\SVNBuddy\Command;
12
13
14
use Stecman\Component\Symfony\Console\BashCompletion\Completion;
15
use Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionInterface;
16
use Stecman\Component\Symfony\Console\BashCompletion\Completion\ShellPathCompletion;
17
use Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand as SymfonyCompletionCommand;
18
use Stecman\Component\Symfony\Console\BashCompletion\CompletionHandler;
19
20
class CompletionCommand extends SymfonyCompletionCommand
21
{
22
23
	/**
24
	 * Configure the CompletionHandler instance before it is run
25
	 *
26
	 * @param CompletionHandler $handler Completion handler.
27
	 *
28
	 * @return void
29
	 */
30
	protected function configureCompletion(CompletionHandler $handler)
31
	{
32
		$handler->addHandler(new ShellPathCompletion(
33
			CompletionInterface::ALL_COMMANDS,
34
		    'path',
35
		    Completion::TYPE_ARGUMENT
36
		));
37
38
		$handler->addHandler(new ShellPathCompletion(
39
			'aggregate',
40
			'ignore-add',
41
			Completion::TYPE_OPTION
42
		));
43
44
		$handler->addHandler(new ShellPathCompletion(
45
			'aggregate',
46
			'ignore-remove',
47
			Completion::TYPE_OPTION
48
		));
49
	}
50
51
}
52