Skip to content

Commit

Permalink
fix: query is for query
Browse files Browse the repository at this point in the history
  • Loading branch information
theus77 committed Feb 1, 2024
1 parent c9d0142 commit 7183dea
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions EMS/core-bundle/src/Command/Revision/DeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->io->title('EMSCO - Revision - Delete');

$queryJson = $this->getOptionStringNull(self::OPTION_QUERY);
if (self::MODE_BY_QUERY === $this->mode) {
return $this->deleteByQuery();
return $this->deleteByQuery($queryJson);
}
if (null !== $queryJson) {
throw new \RuntimeException(\sprintf('The %s option is forbidden in %s mode', self::OPTION_QUERY, $this->mode));
}

$this->io->note(\sprintf('Selected "%s" contentType(s)', \implode(',', $this->contentTypeNames)));
Expand All @@ -101,9 +105,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return parent::EXECUTE_SUCCESS;
}

private function deleteByQuery(): int
private function deleteByQuery(?string $queryJson): int
{
$queryJson = $this->getOptionStringNull(self::OPTION_QUERY);
if (null === $queryJson) {
throw new \RuntimeException(\sprintf('The %s option is required in %s mode', self::OPTION_QUERY, $this->mode));
}
Expand Down

0 comments on commit 7183dea

Please sign in to comment.