CleanupCommand::getAggregatedOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
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 Symfony\Component\Console\Input\InputArgument;
15
use Symfony\Component\Console\Input\InputInterface;
16
use Symfony\Component\Console\Output\OutputInterface;
17
18
class CleanupCommand extends AbstractCommand implements IAggregatorAwareCommand
19
{
20
21
	/**
22
	 * {@inheritdoc}
23
	 */
24
	protected function configure()
25
	{
26
		$this
27
			->setName('cleanup')
28
			->setDescription(
29
				'Recursively clean up the working copy, removing locks, resuming unfinished operations, etc.'
30
			)
31
			->addArgument(
32
				'path',
33
				InputArgument::OPTIONAL,
34
				'Working copy path',
35
				'.'
36
			);
37
38
		parent::configure();
39
	}
40
41
	/**
42
	 * {@inheritdoc}
43
	 */
44
	protected function execute(InputInterface $input, OutputInterface $output)
45
	{
46
		$wc_path = $this->getWorkingCopyPath();
47
48
		$this->io->writeln('Cleaning up working copy ... ');
49
		$command = $this->repositoryConnector->getCommand('cleanup', array($wc_path));
50
		$command->runLive(array(
51
			$wc_path => '.',
52
		));
53
		$this->io->writeln('<info>Done</info>');
54
	}
55
56
	/**
57
	 * Returns option names, that makes sense to use in aggregation mode.
58
	 *
59
	 * @return array
60
	 */
61
	public function getAggregatedOptions()
62
	{
63
		return array();
64
	}
65
66
}
67