Skip to content

Commit

Permalink
Merge pullrequest to simplify encryption/decryption
Browse files Browse the repository at this point in the history
  • Loading branch information
mogilvie committed Jan 5, 2023
1 parent 7fa8ebc commit c769332
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
27 changes: 6 additions & 21 deletions Command/EncryptDatabaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,15 @@

class EncryptDatabaseCommand extends Command
{
protected static $defaultName = 'app:encrypt-database';
protected static $defaultName = 'encrypt:database:encode';

/**
* @var EncryptorInterface
*/
private $encryptor;

/**
* @var EntityManagerInterface
*/
private $entityManager;

/**
* @var Reader
*/
private $annotationReader;

public function __construct(Reader $annotationReader, EncryptorInterface $encryptor, EntityManagerInterface $entityManager)
public function __construct(
private Reader $annotationReader,
private EncryptorInterface $encryptor,
private EntityManagerInterface $entityManager
)
{
parent::__construct();

$this->encryptor = $encryptor;
$this->entityManager = $entityManager;
$this->annotationReader = $annotationReader;
}

protected function configure()
Expand Down
2 changes: 1 addition & 1 deletion Subscribers/DoctrineEncryptSubscriberInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function onFlush(OnFlushEventArgs $args): void;
* After we have persisted the entities, we want to have the
* decrypted information available once more.
*/
public function postFlush(PostFlushEventArgs $args): void;
public function postUpdate(PostFlushEventArgs $args): void;

/**
* Listen a postLoad lifecycle event. Checking and decrypt entities
Expand Down

0 comments on commit c769332

Please sign in to comment.