userator /
deploid
| 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 | use Deploid\Payload; |
||||
| 10 | |||||
| 11 | /** |
||||
| 12 | * @method \Deploid\Application getApplication() return application object |
||||
| 13 | */ |
||||
| 14 | class ReleaseCurrent extends Command { |
||||
| 15 | |||||
| 16 | protected function configure() { |
||||
| 17 | $this->setName('release:current'); |
||||
| 18 | $this->setDescription('Sets the current release'); |
||||
| 19 | $this->setHelp('This command sets the current release'); |
||||
| 20 | $this->addArgument('path', InputArgument::OPTIONAL, 'path to target directory', getcwd()); |
||||
| 21 | } |
||||
| 22 | |||||
| 23 | protected function execute(InputInterface $input, OutputInterface $output) { |
||||
| 24 | $payload = $this->getApplication()->deploidStructureValidate($input->getArgument('path')); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 25 | if ($payload->getType() == Payload::STRUCTURE_VALIDATE_FAIL) { |
||||
| 26 | $output->writeln($payload->getMessage()); |
||||
| 27 | return $payload->getCode(); |
||||
| 28 | } |
||||
| 29 | |||||
| 30 | $payload = $this->getApplication()->deploidReleaseCurrent($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::deploidReleaseCurrent() 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
Loading history...
|
|||||
| 31 | $output->writeln($payload->getMessage()); |
||||
| 32 | return $payload->getCode(); |
||||
| 33 | } |
||||
| 34 | |||||
| 35 | } |