Issues (25)

src/Command/StructureInit.php (1 issue)

Labels
Severity
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
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
}