diff options
Diffstat (limited to 'core/Command/Encryption/Enable.php')
-rw-r--r-- | core/Command/Encryption/Enable.php | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/core/Command/Encryption/Enable.php b/core/Command/Encryption/Enable.php index 9d680144e60..2cbb315283e 100644 --- a/core/Command/Encryption/Enable.php +++ b/core/Command/Encryption/Enable.php @@ -29,14 +29,11 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class Enable extends Command { - protected IConfig $config; - protected IManager $encryptionManager; - - public function __construct(IConfig $config, IManager $encryptionManager) { + public function __construct( + protected IConfig $config, + protected IManager $encryptionManager, + ) { parent::__construct(); - - $this->encryptionManager = $encryptionManager; - $this->config = $config; } protected function configure() { @@ -59,18 +56,18 @@ class Enable extends Command { if (empty($modules)) { $output->writeln('<error>No encryption module is loaded</error>'); return 1; - } else { - $defaultModule = $this->config->getAppValue('core', 'default_encryption_module', null); - if ($defaultModule === null) { - $output->writeln('<error>No default module is set</error>'); - return 1; - } elseif (!isset($modules[$defaultModule])) { - $output->writeln('<error>The current default module does not exist: ' . $defaultModule . '</error>'); - return 1; - } else { - $output->writeln('Default module: ' . $defaultModule); - } } + $defaultModule = $this->config->getAppValue('core', 'default_encryption_module', null); + if ($defaultModule === null) { + $output->writeln('<error>No default module is set</error>'); + return 1; + } + if (!isset($modules[$defaultModule])) { + $output->writeln('<error>The current default module does not exist: ' . $defaultModule . '</error>'); + return 1; + } + $output->writeln('Default module: ' . $defaultModule); + return 0; } } |