Completed
Push — master ( 94e04a...7e753b )
by C
05:18
created

ExtractListener::prepareCommand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
namespace Tartana\Event\Listener;
3
use Tartana\Component\Archive\Extract;
4
use Tartana\Component\Command\Command;
5
use Tartana\Util;
6
7
class ExtractListener extends AbstractProcessingListener
8
{
9
10 7
	protected function getConfigurationKey ()
11
	{
12 7
		return 'extract.destination';
13
	}
14
15 3
	protected function getFileExtensionsForCommand ()
16
	{
17
		return [
18 3
				'rar' => 'unrar',
19
				'zip' => 'unzip',
20
				'7z' => '7z'
21
		];
22
	}
23
24 3
	protected function prepareCommand (Command $command)
25
	{
26 3
		$command->addArgument(Util::realPath($this->configuration->get('extract.passwordFile')));
27
28 3
		return $command;
29
	}
30
}
31