Passed
Push — master ( 21ea66...db5c4e )
by Kirill
02:53
created
src/Encrypter/tests/EncrypterTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
         $this->assertNotEquals('test string', $encrypted);
62 62
         $this->assertEquals('test string', $encrypter->decrypt($encrypted));
63 63
 
64
-        $encrypter->decrypt('badData.' . $encrypted);
64
+        $encrypter->decrypt('badData.'.$encrypted);
65 65
     }
66 66
 
67 67
     public function testBadKey(): void
Please login to merge, or discard this patch.
src/Encrypter/src/Encrypter.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
      */
38 38
     public function __construct(string $key)
39 39
     {
40
-        try {
40
+        try{
41 41
             $this->key = Key::loadFromAsciiSafeString($key);
42
-        } catch (CryptoException $e) {
42
+        }catch (CryptoException $e){
43 43
             throw new EncrypterException($e->getMessage(), $e->getCode(), $e);
44 44
         }
45 45
     }
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
     public function withKey(string $key): EncrypterInterface
51 51
     {
52 52
         $encrypter = clone $this;
53
-        try {
53
+        try{
54 54
             $encrypter->key = Key::loadFromAsciiSafeString($key);
55
-        } catch (CryptoException $e) {
55
+        }catch (CryptoException $e){
56 56
             throw new EncrypterException($e->getMessage(), $e->getCode(), $e);
57 57
         }
58 58
 
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
      */
65 65
     public function getKey(): string
66 66
     {
67
-        try {
67
+        try{
68 68
             return $this->key->saveToAsciiSafeString();
69
-        } catch (EnvironmentIsBrokenException $e) {
69
+        }catch (EnvironmentIsBrokenException $e){
70 70
             throw new EncrypterException($e->getMessage(), $e->getCode(), $e);
71 71
         }
72 72
     }
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
     {
81 81
         $packed = json_encode($data);
82 82
 
83
-        try {
83
+        try{
84 84
             return base64_encode(Crypto::Encrypt($packed, $this->key));
85
-        } catch (\Throwable $e) {
85
+        }catch (\Throwable $e){
86 86
             throw new EncryptException($e->getMessage(), $e->getCode(), $e);
87 87
         }
88 88
     }
@@ -94,14 +94,14 @@  discard block
 block discarded – undo
94 94
      */
95 95
     public function decrypt(string $payload)
96 96
     {
97
-        try {
97
+        try{
98 98
             $result = Crypto::Decrypt(
99 99
                 base64_decode($payload),
100 100
                 $this->key
101 101
             );
102 102
 
103 103
             return json_decode($result, true);
104
-        } catch (\Throwable $e) {
104
+        }catch (\Throwable $e){
105 105
             throw new DecryptException($e->getMessage(), $e->getCode(), $e);
106 106
         }
107 107
     }
Please login to merge, or discard this patch.
src/Encrypter/src/EncrypterFactory.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function generateKey(): string
42 42
     {
43
-        try {
43
+        try{
44 44
             return Key::createNewRandomKey()->saveToAsciiSafeString();
45
-        } catch (CryptoException $e) {
45
+        }catch (CryptoException $e){
46 46
             throw new EncrypterException($e->getMessage(), $e->getCode(), $e);
47 47
         }
48 48
     }
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function getKey(): string
54 54
     {
55
-        try {
55
+        try{
56 56
             Key::loadFromAsciiSafeString($this->config->getKey());
57
-        } catch (CryptoException $e) {
57
+        }catch (CryptoException $e){
58 58
             throw new EncrypterException($e->getMessage(), $e->getCode(), $e);
59 59
         }
60 60
 
Please login to merge, or discard this patch.