RemoveCommand::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 7
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
/**
3
 * For the full copyright and license information, please view the LICENSE.md
4
 * file that was distributed with this source code.
5
 */
6
7
namespace Notamedia\ConsoleJedi\Module\Command;
8
9
use Notamedia\ConsoleJedi\Module\Module;
10
use Symfony\Component\Console\Input\InputInterface;
11
use Symfony\Component\Console\Output\OutputInterface;
12
13
/**
14
 * Command for module installation/register
15
 *
16
 * @author Marat Shamshutdinov <[email protected]>
17
 */
18 View Code Duplication
class RemoveCommand extends ModuleCommand
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
19
{
20
	/**
21
	 * {@inheritdoc}
22
	 */
23
	protected function configure()
24
	{
25
		parent::configure();
26
27
		$this->setName('module:remove')
28
			->setDescription('Uninstall and remove module folder from system');
29
	}
30
31
	/**
32
	 * {@inheritdoc}
33
	 */
34
	protected function execute(InputInterface $input, OutputInterface $output)
35
	{
36
		$module = new Module($input->getArgument('module'));
37
		$module->remove();
38
		$output->writeln(sprintf('removed <info>%s</info>', $module->getName()));
39
	}
40
}