Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Make CleanUpCommand compatible with symfony/console:^7 - #38 #40

Merged
merged 1 commit into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Classes/Command/CleanUpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,20 @@ protected function configure(): void
* @throws DBALException
* @throws Exception
*/
public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$this->output = $output;

if (!$this->isInputValid($input)) {
$output->writeln(sprintf('<error>Unknown method: %s</error>', $input->getArgument('method')));

return;
return Command::FAILURE;
}

if (!$this->isBackendLoginEnabled()) {
$output->writeln('<error>Backend login is not enabled.</error>');

return;
return Command::FAILURE;
}

if ($this->setUsers()) {
Expand All @@ -94,6 +94,8 @@ public function execute(InputInterface $input, OutputInterface $output)
} else {
$output->writeln(sprintf('<info>No users removed for table %s.</info>', $this->tableNames['users']));
}

return Command::SUCCESS;
}

protected function isInputValid(InputInterface $input): bool
Expand Down
Loading