diff --git a/src/Command/DoctrineDecryptDatabaseCommand.php b/src/Command/DoctrineDecryptDatabaseCommand.php index c677111d..22e1c1ec 100644 --- a/src/Command/DoctrineDecryptDatabaseCommand.php +++ b/src/Command/DoctrineDecryptDatabaseCommand.php @@ -33,7 +33,7 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { // Get entity manager, question helper, subscriber service and annotation reader $question = $this->getHelper('question'); @@ -82,7 +82,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ); if (!$question->ask($input, $output, $confirmationQuestion)) { - return 1; + return self::FAILURE; } // Start decrypting database @@ -146,5 +146,6 @@ protected function execute(InputInterface $input, OutputInterface $output) } $output->writeln('' . PHP_EOL . 'Decryption finished values found: ' . $valueCounter . ', decrypted: ' . $this->subscriber->decryptCounter . '.' . PHP_EOL . 'All values are now decrypted.'); + return self::SUCCESS; } } diff --git a/src/Command/DoctrineEncryptDatabaseCommand.php b/src/Command/DoctrineEncryptDatabaseCommand.php index f5d371c8..0da0a762 100644 --- a/src/Command/DoctrineEncryptDatabaseCommand.php +++ b/src/Command/DoctrineEncryptDatabaseCommand.php @@ -32,7 +32,7 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { // Get entity manager, question helper, subscriber service and annotation reader $question = $this->getHelper('question'); @@ -69,7 +69,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ); if (!$question->ask($input, $output, $confirmationQuestion)) { - return 1; + return self::FAILURE; } // Start decrypting database @@ -101,6 +101,7 @@ protected function execute(InputInterface $input, OutputInterface $output) // Say it is finished $output->writeln('Encryption finished. Values encrypted: ' . $this->subscriber->encryptCounter . ' values.' . PHP_EOL . 'All values are now encrypted.'); + return self::SUCCESS; } diff --git a/src/Command/DoctrineEncryptStatusCommand.php b/src/Command/DoctrineEncryptStatusCommand.php index 37b826ac..01d3709e 100644 --- a/src/Command/DoctrineEncryptStatusCommand.php +++ b/src/Command/DoctrineEncryptStatusCommand.php @@ -27,7 +27,7 @@ protected function configure() /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $metaDataArray = $this->entityManager->getMetadataFactory()->getAllMetadata(); @@ -53,5 +53,6 @@ protected function execute(InputInterface $input, OutputInterface $output) $output->writeln(''); $output->writeln(sprintf('%d entities found which are containing %d encrypted properties.', count($metaDataArray), $totalCount)); + return self::SUCCESS; } }