diff --git a/core/Command/Encryption/EncryptAll.php b/core/Command/Encryption/EncryptAll.php index 99c9fe1658b..d453d575d1a 100644 --- a/core/Command/Encryption/EncryptAll.php +++ b/core/Command/Encryption/EncryptAll.php @@ -90,25 +90,21 @@ class EncryptAll extends Command { $question = new ConfirmationQuestion('Do you really want to continue? (y/n) ', true); if ($this->questionHelper->ask($input, $output, $question)) { //run encryption with the answer yes in interactive mode - return $this->runEncryption($input, $output); - } - //abort on no in interactive mode - $output->writeln('aborted'); - return self::FAILURE; - } + $this->forceMaintenanceAndTrashbin(); - private function runEncryption(InputInterface $input, OutputInterface $output): int { - $this->forceMaintenanceAndTrashbin(); + try { + $defaultModule = $this->encryptionManager->getEncryptionModule(); + $defaultModule->encryptAll($input, $output); + } catch (\Exception $ex) { + $this->resetMaintenanceAndTrashbin(); + throw $ex; + } - try { - $defaultModule = $this->encryptionManager->getEncryptionModule(); - $defaultModule->encryptAll($input, $output); - } catch (\Exception $ex) { $this->resetMaintenanceAndTrashbin(); - throw $ex; + return self::SUCCESS; } - - $this->resetMaintenanceAndTrashbin(); - return self::SUCCESS; + //abort on no in interactive mode + $output->writeln('aborted'); + return self::FAILURE; } }