Minor code tidy up

This commit is contained in:
Andrew Millington
2018-02-28 20:33:19 +00:00
parent c9b07f386c
commit a56acc8dd0
5 changed files with 25 additions and 17 deletions

View File

@@ -35,9 +35,9 @@ trait CryptTrait
try {
if ($this->encryptionKey instanceof Key) {
return Crypto::encrypt($unencryptedData, $this->encryptionKey);
} else {
return Crypto::encryptWithPassword($unencryptedData, $this->encryptionKey);
}
return Crypto::encryptWithPassword($unencryptedData, $this->encryptionKey);
} catch (\Exception $e) {
throw new \LogicException($e->getMessage());
}
@@ -57,9 +57,9 @@ trait CryptTrait
try {
if ($this->encryptionKey instanceof Key) {
return Crypto::decrypt($encryptedData, $this->encryptionKey);
} else {
return Crypto::decryptWithPassword($encryptedData, $this->encryptionKey);
}
return Crypto::decryptWithPassword($encryptedData, $this->encryptionKey);
} catch (\Exception $e) {
throw new \LogicException($e->getMessage());
}