diff --git a/composer.json b/composer.json index c463c326..40e1ff29 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "license": "MIT", "description": "Encrypted symfony entity's by verified and standardized libraries", "require": { - "php": "^7.2", + "php": "^7.2|^8.0", "paragonie/halite": "^4.6", "paragonie/sodium_compat": "^1.5", "doctrine/orm": "^2.5", diff --git a/src/Command/DoctrineDecryptDatabaseCommand.php b/src/Command/DoctrineDecryptDatabaseCommand.php index c677111d..fa2fc731 100644 --- a/src/Command/DoctrineDecryptDatabaseCommand.php +++ b/src/Command/DoctrineDecryptDatabaseCommand.php @@ -82,7 +82,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ); if (!$question->ask($input, $output, $confirmationQuestion)) { - return 1; + return AbstractCommand::FAILURE; } // Start decrypting database @@ -146,5 +146,7 @@ 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 AbstractCommand::SUCCESS; } } diff --git a/src/Command/DoctrineEncryptDatabaseCommand.php b/src/Command/DoctrineEncryptDatabaseCommand.php index f5d371c8..6a2b9846 100644 --- a/src/Command/DoctrineEncryptDatabaseCommand.php +++ b/src/Command/DoctrineEncryptDatabaseCommand.php @@ -69,7 +69,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ); if (!$question->ask($input, $output, $confirmationQuestion)) { - return 1; + return AbstractCommand::FAILURE; } // Start decrypting database @@ -101,6 +101,8 @@ 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 AbstractCommand::SUCCESS; } diff --git a/src/Command/DoctrineEncryptStatusCommand.php b/src/Command/DoctrineEncryptStatusCommand.php index 37b826ac..be86ed90 100644 --- a/src/Command/DoctrineEncryptStatusCommand.php +++ b/src/Command/DoctrineEncryptStatusCommand.php @@ -53,5 +53,7 @@ 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 AbstractCommand::SUCCESS; } } diff --git a/src/Resources/doc/commands.md b/src/Resources/doc/commands.md index 5a6b6590..c2c7fad7 100644 --- a/src/Resources/doc/commands.md +++ b/src/Resources/doc/commands.md @@ -7,7 +7,7 @@ To make your life a little easier we created some commands that you can use for You can use the comment `doctrine:encrypt:status` to get the current database and encryption information. ``` -$ php app/console doctrine:encrypt:status +$ php bin/console doctrine:encrypt:status ``` This command will return the amount of entities and the amount of properties with the @Encrypted tag for each entity. @@ -29,17 +29,17 @@ You can use the comment `doctrine:encrypt:database [encryptor]` to encrypt the c * Default: Your encryptor set in the configuration file or the default encryption class when not set in the configuration file ``` -$ php app/console doctrine:encrypt:database +$ php bin/console doctrine:encrypt:database ``` or you can provide an encryptor (optional). ``` -$ php app/console doctrine:encrypt:database Defuse +$ php bin/console doctrine:encrypt:database Defuse ``` ``` -$ php app/console doctrine:encrypt:database Halite +$ php bin/console doctrine:encrypt:database Halite ``` This command will return the amount of values encrypted in the database. @@ -58,17 +58,17 @@ You can use the comment `doctrine:decrypt:database [encryptor]` to decrypt the c * Default: Your encryptor set in the configuration file or the default encryption class when not set in the configuration file ``` -$ php app/console doctrine:decrypt:database +$ php bin/console doctrine:decrypt:database ``` or you can provide an encryptor (optional). ``` -$ php app/console doctrine:decrypt:database Defuse +$ php bin/console doctrine:decrypt:database Defuse ``` ``` -$ php app/console doctrine:decrypt:database Halite +$ php bin/console doctrine:decrypt:database Halite ``` This command will return the amount of entities and the amount of values decrypted in the database.