StructureInit   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 13
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 4 1
A configure() 0 5 1
1
<?php
2
3
namespace Deploid\Command;
4
5
use Symfony\Component\Console\Command\Command;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
use Symfony\Component\Console\Input\InputArgument;
9
10
/**
11
 * @method \Deploid\Application getApplication() return application object
12
 */
13
class StructureInit extends Command {
14
15
	protected function configure() {
16
		$this->setName('structure:init');
17
		$this->setDescription('Initialize new directory structure');
18
		$this->setHelp('This command initialize a directory structure in the specified path');
19
		$this->addArgument('path', InputArgument::OPTIONAL, 'path to target directory', getcwd());
20
	}
21
22
	protected function execute(InputInterface $input, OutputInterface $output) {
23
		$payload = $this->getApplication()->deploidStructureInit($input->getArgument('path'));
0 ignored issues
show
Bug introduced by
It seems like $input->getArgument('path') can also be of type string[]; however, parameter $path of Deploid\Application::deploidStructureInit() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

23
		$payload = $this->getApplication()->deploidStructureInit(/** @scrutinizer ignore-type */ $input->getArgument('path'));
Loading history...
24
		$output->writeln($payload->getMessage());
25
		return $payload->getCode();
26
	}
27
28
}