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

Add missing return value for Command's execute() methods (Symfony >= 4.4) #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions src/Command/DoctrineDecryptDatabaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -146,5 +146,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$output->writeln('' . PHP_EOL . 'Decryption finished values found: <info>' . $valueCounter . '</info>, decrypted: <info>' . $this->subscriber->decryptCounter . '</info>.' . PHP_EOL . 'All values are now decrypted.');
return self::SUCCESS;
}
}
5 changes: 3 additions & 2 deletions src/Command/DoctrineEncryptDatabaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -101,6 +101,7 @@ protected function execute(InputInterface $input, OutputInterface $output)

// Say it is finished
$output->writeln('Encryption finished. Values encrypted: <info>' . $this->subscriber->encryptCounter . ' values</info>.' . PHP_EOL . 'All values are now encrypted.');
return self::SUCCESS;
}


Expand Down
3 changes: 2 additions & 1 deletion src/Command/DoctrineEncryptStatusCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -53,5 +53,6 @@ protected function execute(InputInterface $input, OutputInterface $output)

$output->writeln('');
$output->writeln(sprintf('<info>%d</info> entities found which are containing <info>%d</info> encrypted properties.', count($metaDataArray), $totalCount));
return self::SUCCESS;
}
}