X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FHelper%2FCryptoProxy.php;h=7d8c9888800d445be8ccf891bf57f780a04d3c3d;hb=f808b01692a835673f328d7221ba8c212caa9b61;hp=e8b19cb9ec650667cc351edb1bf11ea4642a388c;hpb=822c877949aff8ae57677671115f8f4fc69588d5;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Helper/CryptoProxy.php b/src/Wallabag/CoreBundle/Helper/CryptoProxy.php index e8b19cb9..7d8c9888 100644 --- a/src/Wallabag/CoreBundle/Helper/CryptoProxy.php +++ b/src/Wallabag/CoreBundle/Helper/CryptoProxy.php @@ -2,10 +2,10 @@ namespace Wallabag\CoreBundle\Helper; -use Psr\Log\LoggerInterface; -use Defuse\Crypto\Key; use Defuse\Crypto\Crypto; use Defuse\Crypto\Exception\WrongKeyOrModifiedCiphertextException; +use Defuse\Crypto\Key; +use Psr\Log\LoggerInterface; /** * This is a proxy to crypt and decrypt password used by SiteCredential entity. @@ -39,7 +39,7 @@ class CryptoProxy */ public function crypt($secretValue) { - $this->logger->debug('Crypto: crypting value: '.$this->mask($secretValue)); + $this->logger->debug('Crypto: crypting value: ' . $this->mask($secretValue)); return Crypto::encrypt($secretValue, $this->loadKey()); } @@ -53,12 +53,12 @@ class CryptoProxy */ public function decrypt($cryptedValue) { - $this->logger->debug('Crypto: decrypting value: '.$this->mask($cryptedValue)); + $this->logger->debug('Crypto: decrypting value: ' . $this->mask($cryptedValue)); try { return Crypto::decrypt($cryptedValue, $this->loadKey()); } catch (WrongKeyOrModifiedCiphertextException $e) { - throw new \RuntimeException('Decrypt fail: '.$e->getMessage()); + throw new \RuntimeException('Decrypt fail: ' . $e->getMessage()); } } @@ -81,6 +81,6 @@ class CryptoProxy */ private function mask($value) { - return strlen($value) > 0 ? $value[0].'*****'.$value[strlen($value) - 1] : 'Empty value'; + return strlen($value) > 0 ? $value[0] . '*****' . $value[strlen($value) - 1] : 'Empty value'; } }