Passed
Branch feature/remove-ocra-v1 (68bd7c)
by Pieter van der
04:02
created
library/tiqr/Tiqr/Service.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -453,7 +453,9 @@
 block discarded – undo
453 453
             $sessionId = session_id(); 
454 454
         }
455 455
         $status = $this->_stateStorage->getValue("enrollstatus".$sessionId);
456
-        if (is_null($status)) return self::ENROLLMENT_STATUS_IDLE;
456
+        if (is_null($status)) {
457
+            return self::ENROLLMENT_STATUS_IDLE;
458
+        }
457 459
         return $status;
458 460
     }
459 461
         
Please login to merge, or discard this patch.
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -584,17 +584,17 @@  discard block
 block discarded – undo
584 584
         }
585 585
 
586 586
         $metadata = array("service"=>
587
-                               array("displayName"       => $this->_name,
588
-                                     "identifier"        => $this->_identifier,
589
-                                     "logoUrl"           => $this->_logoUrl,
590
-                                     "infoUrl"           => $this->_infoUrl,
591
-                                     "authenticationUrl" => $authenticationUrl,
592
-                                     "ocraSuite"         => $this->_ocraSuite,
593
-                                     "enrollmentUrl"     => $enrollmentUrl
594
-                               ),
595
-                          "identity"=>
596
-                               array("identifier" =>$data["userId"],
597
-                                     "displayName"=>$data["displayName"]));
587
+                                array("displayName"       => $this->_name,
588
+                                        "identifier"        => $this->_identifier,
589
+                                        "logoUrl"           => $this->_logoUrl,
590
+                                        "infoUrl"           => $this->_infoUrl,
591
+                                        "authenticationUrl" => $authenticationUrl,
592
+                                        "ocraSuite"         => $this->_ocraSuite,
593
+                                        "enrollmentUrl"     => $enrollmentUrl
594
+                                ),
595
+                            "identity"=>
596
+                                array("identifier" =>$data["userId"],
597
+                                        "displayName"=>$data["displayName"]));
598 598
 
599 599
         $this->_stateStorage->unsetValue(self::PREFIX_ENROLLMENT . $enrollmentKey);
600 600
 
@@ -618,18 +618,18 @@  discard block
 block discarded – undo
618 618
      */
619 619
     public function getEnrollmentSecret(string $enrollmentKey): string
620 620
     {
621
-         $data = $this->_stateStorage->getValue(self::PREFIX_ENROLLMENT . $enrollmentKey);
622
-         $secret = $this->_uniqueSessionKey(self::PREFIX_ENROLLMENT_SECRET);
623
-         $enrollmentData = [
624
-             "userId" => $data["userId"],
625
-             "sessionId" => $data["sessionId"]
626
-         ];
627
-         $this->_stateStorage->setValue(
628
-             self::PREFIX_ENROLLMENT_SECRET . $secret,
629
-             $enrollmentData,
630
-             self::ENROLLMENT_EXPIRE
631
-         );
632
-         return $secret;
621
+            $data = $this->_stateStorage->getValue(self::PREFIX_ENROLLMENT . $enrollmentKey);
622
+            $secret = $this->_uniqueSessionKey(self::PREFIX_ENROLLMENT_SECRET);
623
+            $enrollmentData = [
624
+                "userId" => $data["userId"],
625
+                "sessionId" => $data["sessionId"]
626
+            ];
627
+            $this->_stateStorage->setValue(
628
+                self::PREFIX_ENROLLMENT_SECRET . $secret,
629
+                $enrollmentData,
630
+                self::ENROLLMENT_EXPIRE
631
+            );
632
+            return $secret;
633 633
     } 
634 634
 
635 635
     /**
@@ -668,18 +668,18 @@  discard block
 block discarded – undo
668 668
      */
669 669
     public function finalizeEnrollment($enrollmentSecret) 
670 670
     {
671
-         $data = $this->_stateStorage->getValue(self::PREFIX_ENROLLMENT_SECRET.$enrollmentSecret);
672
-         if (is_array($data)) {
673
-             // Enrollment is finalized, destroy our session data.
674
-             $this->_setEnrollmentStatus($data["sessionId"], self::ENROLLMENT_STATUS_FINALIZED);
675
-             $this->_stateStorage->unsetValue(self::PREFIX_ENROLLMENT_SECRET.$enrollmentSecret);
676
-         } else {
677
-             $this->logger->error(
678
-                 'Enrollment status is not finalized, enrollmentsecret was not found in state storage. ' .
679
-                 'Warning! the method will still return "true" as a result.'
680
-             );
681
-         }
682
-         return true;
671
+            $data = $this->_stateStorage->getValue(self::PREFIX_ENROLLMENT_SECRET.$enrollmentSecret);
672
+            if (is_array($data)) {
673
+                // Enrollment is finalized, destroy our session data.
674
+                $this->_setEnrollmentStatus($data["sessionId"], self::ENROLLMENT_STATUS_FINALIZED);
675
+                $this->_stateStorage->unsetValue(self::PREFIX_ENROLLMENT_SECRET.$enrollmentSecret);
676
+            } else {
677
+                $this->logger->error(
678
+                    'Enrollment status is not finalized, enrollmentsecret was not found in state storage. ' .
679
+                    'Warning! the method will still return "true" as a result.'
680
+                );
681
+            }
682
+            return true;
683 683
     }
684 684
 
685 685
     /**
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 
717 717
         $challengeUserId = NULL;
718 718
         if (isset($state["userId"])) {
719
-          $challengeUserId = $state["userId"];
719
+            $challengeUserId = $state["userId"];
720 720
         }
721 721
         // Check if we're dealing with a second factor
722 722
         if ($challengeUserId!=NULL && ($userId != $challengeUserId)) {
@@ -864,6 +864,6 @@  discard block
 block discarded – undo
864 864
      */
865 865
     protected function _setEnrollmentStatus($sessionId, $status)
866 866
     {
867
-       $this->_stateStorage->setValue("enrollstatus".$sessionId, $status, self::ENROLLMENT_EXPIRE);
867
+        $this->_stateStorage->setValue("enrollstatus".$sessionId, $status, self::ENROLLMENT_EXPIRE);
868 868
     }
869 869
 }
Please login to merge, or discard this patch.
library/tiqr/Tiqr/Message/Exception.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@
 block discarded – undo
29 29
      * @param string    $message    exception message
30 30
      * @param Exception $parent     parent exception
31 31
      */
32
-     public function __construct($message, $parent=null)
33
-     {
34
-         parent::__construct($message, 0, $parent);
35
-     }
32
+        public function __construct($message, $parent=null)
33
+        {
34
+            parent::__construct($message, 0, $parent);
35
+        }
36 36
 }
37 37
\ No newline at end of file
Please login to merge, or discard this patch.
library/tiqr/Tiqr/Message/FCM.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -97,9 +97,9 @@
 block discarded – undo
97 97
 
98 98
         // Wait and retry once in case of a 502 Bad Gateway error
99 99
         if ($statusCode === 502 && !($retry)) {
100
-          sleep(2);
101
-          $this->_sendFirebase($deviceToken, $alert, $challenge, $apiKey, true);
102
-          return;
100
+            sleep(2);
101
+            $this->_sendFirebase($deviceToken, $alert, $challenge, $apiKey, true);
102
+            return;
103 103
         }
104 104
 
105 105
         if ($statusCode !== 200) {
Please login to merge, or discard this patch.
library/tiqr/Tiqr/UserSecretStorage/Encryption/Interface.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
     public function encrypt($data);
42 42
     
43 43
     /**
44
-      * Decrypts the given data.
44
+     * Decrypts the given data.
45 45
      *
46 46
      * @param String $data Data to decrypt.
47 47
      *
Please login to merge, or discard this patch.
library/tiqr/Tiqr/UserSecretStorage/Encryption/Mcrypt.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
     }
58 58
     
59 59
     /**
60
-      * Decrypts the given data.
60
+     * Decrypts the given data.
61 61
      *
62 62
      * @param String $data Data to decrypt.
63 63
      *
Please login to merge, or discard this patch.
library/tiqr/Tiqr/UserSecretStorage/Encryption/Dummy.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
     }
58 58
     
59 59
     /**
60
-      * Decrypts the given data.
60
+     * Decrypts the given data.
61 61
      *
62 62
      * @param String $data Data to decrypt.
63 63
      *
Please login to merge, or discard this patch.
library/tiqr/Tiqr/AutoLoader.php 1 patch
Indentation   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -1,102 +1,102 @@
 block discarded – undo
1 1
 <?php
2 2
 class Tiqr_AutoLoader {
3 3
 
4
-	protected static $instance;
5
-
6
-	protected $tiqrPath;
7
-	protected $qrcodePath;
8
-	protected $zendPath;
9
-
10
-	protected function __construct($options) {
11
-		if ($options !== NULL) {
12
-			$this->setOptions($options);
13
-		}
14
-		spl_autoload_register(array(__CLASS__, 'autoload'));
15
-	}
16
-
17
-	public static function getInstance($options = NULL) {
18
-		if (null === self::$instance) {
19
-			self::$instance = new self($options);
20
-		}
21
-
22
-		return self::$instance;
23
-	}
24
-
25
-	public static function autoload($className) {
26
-		if($className === NULL) {
27
-			return;
28
-		}
29
-
30
-		$self = self::getInstance();
31
-
32
-		$substr5 = substr($className, 0, 5);
33
-
34
-		if ($substr5 === 'Tiqr_' || $substr5 === 'OATH_') {
35
-			$file = $self->tiqrPath . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
36
-		} elseif ($className === 'QRcode') {
37
-			$file = $self->qrcodePath . DIRECTORY_SEPARATOR . 'qrlib.php';
38
-		} elseif ($substr5 === 'Zend_') {
39
-			$file = $self->zendPath . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
4
+    protected static $instance;
5
+
6
+    protected $tiqrPath;
7
+    protected $qrcodePath;
8
+    protected $zendPath;
9
+
10
+    protected function __construct($options) {
11
+        if ($options !== NULL) {
12
+            $this->setOptions($options);
13
+        }
14
+        spl_autoload_register(array(__CLASS__, 'autoload'));
15
+    }
16
+
17
+    public static function getInstance($options = NULL) {
18
+        if (null === self::$instance) {
19
+            self::$instance = new self($options);
20
+        }
21
+
22
+        return self::$instance;
23
+    }
24
+
25
+    public static function autoload($className) {
26
+        if($className === NULL) {
27
+            return;
28
+        }
29
+
30
+        $self = self::getInstance();
31
+
32
+        $substr5 = substr($className, 0, 5);
33
+
34
+        if ($substr5 === 'Tiqr_' || $substr5 === 'OATH_') {
35
+            $file = $self->tiqrPath . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
36
+        } elseif ($className === 'QRcode') {
37
+            $file = $self->qrcodePath . DIRECTORY_SEPARATOR . 'qrlib.php';
38
+        } elseif ($substr5 === 'Zend_') {
39
+            $file = $self->zendPath . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
40 40
         } elseif ($className === 'ReadWriteException') {
41 41
             $file = $self->tiqrPath . DIRECTORY_SEPARATOR . 'Tiqr/Exception/ReadWriteException.php';
42
-		} else {
43
-			return;
44
-		}
45
-
46
-		if (file_exists($file)) {
47
-			require_once($file);
48
-		}
49
-	}
50
-
51
-	public function setOptions($options) {
52
-		if (isset($options["tiqr.path"])) {
53
-			$tiqr_dir = $options["tiqr.path"];
54
-			$tiqr_path = realpath($tiqr_dir);
55
-		} else {
56
-			$tiqr_dir = dirname(__FILE__);
57
-			$tiqr_path = $tiqr_dir;
58
-		}
59
-		if (is_dir($tiqr_path)) {
60
-			$this->tiqrPath = $tiqr_path;
61
-		} else {
62
-			throw new Exception('Directory not found: ' . var_export($tiqr_dir, TRUE));
63
-		}
64
-
65
-		if (isset($options["phpqrcode.path"])) {
66
-			$qrcode_dir = $options["phpqrcode.path"];
67
-			$qrcode_path = realpath($qrcode_dir);
68
-		} else {
69
-			$qrcode_dir = dirname(dirname(dirname(__FILE__))) . '/phpqrcode';
70
-			$qrcode_path = $qrcode_dir;
71
-		}
72
-
73
-		if (is_dir($qrcode_path)) {
74
-			$this->qrcodePath = $qrcode_path;
75
-		} else {
76
-			throw new Exception('Directory not found: ' . var_export($qrcode_dir, TRUE));
77
-		}
78
-
79
-		if (isset($options["zend.path"])) {
80
-			$zend_dir = $options["zend.path"];
81
-			$zend_path = realpath($zend_dir);
82
-		} else {
83
-			$zend_dir = dirname(dirname(dirname(__FILE__))) . "/zend";
84
-			$zend_path = $zend_dir;
85
-		}
86
-		if (is_dir($zend_path)) {
87
-			$this->zendPath = $zend_path;
88
-		} else {
89
-			throw new Exception('Directory not found: ' . var_export($zend_dir, TRUE));
90
-		}
91
-	}
92
-
93
-
94
-	public function setIncludePath() {
95
-		set_include_path(implode(PATH_SEPARATOR, array(
96
-			$this->tiqrPath,
97
-			$this->zendPath,
98
-			$this->qrcodePath,
99
-			get_include_path(),
100
-		)));
101
-	}
42
+        } else {
43
+            return;
44
+        }
45
+
46
+        if (file_exists($file)) {
47
+            require_once($file);
48
+        }
49
+    }
50
+
51
+    public function setOptions($options) {
52
+        if (isset($options["tiqr.path"])) {
53
+            $tiqr_dir = $options["tiqr.path"];
54
+            $tiqr_path = realpath($tiqr_dir);
55
+        } else {
56
+            $tiqr_dir = dirname(__FILE__);
57
+            $tiqr_path = $tiqr_dir;
58
+        }
59
+        if (is_dir($tiqr_path)) {
60
+            $this->tiqrPath = $tiqr_path;
61
+        } else {
62
+            throw new Exception('Directory not found: ' . var_export($tiqr_dir, TRUE));
63
+        }
64
+
65
+        if (isset($options["phpqrcode.path"])) {
66
+            $qrcode_dir = $options["phpqrcode.path"];
67
+            $qrcode_path = realpath($qrcode_dir);
68
+        } else {
69
+            $qrcode_dir = dirname(dirname(dirname(__FILE__))) . '/phpqrcode';
70
+            $qrcode_path = $qrcode_dir;
71
+        }
72
+
73
+        if (is_dir($qrcode_path)) {
74
+            $this->qrcodePath = $qrcode_path;
75
+        } else {
76
+            throw new Exception('Directory not found: ' . var_export($qrcode_dir, TRUE));
77
+        }
78
+
79
+        if (isset($options["zend.path"])) {
80
+            $zend_dir = $options["zend.path"];
81
+            $zend_path = realpath($zend_dir);
82
+        } else {
83
+            $zend_dir = dirname(dirname(dirname(__FILE__))) . "/zend";
84
+            $zend_path = $zend_dir;
85
+        }
86
+        if (is_dir($zend_path)) {
87
+            $this->zendPath = $zend_path;
88
+        } else {
89
+            throw new Exception('Directory not found: ' . var_export($zend_dir, TRUE));
90
+        }
91
+    }
92
+
93
+
94
+    public function setIncludePath() {
95
+        set_include_path(implode(PATH_SEPARATOR, array(
96
+            $this->tiqrPath,
97
+            $this->zendPath,
98
+            $this->qrcodePath,
99
+            get_include_path(),
100
+        )));
101
+    }
102 102
 }
Please login to merge, or discard this patch.
library/tiqr/Tiqr/OATH/OCRA.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -36,11 +36,11 @@  discard block
 block discarded – undo
36 36
      */
37 37
     private static function _hmac(string $crypto, string $keyBytes, string $text) : string
38 38
     {
39
-         $hash = hash_hmac($crypto, $text, $keyBytes);
40
-         if (false === $hash) {
41
-             throw new Exception("calculating hash_hmac failed");
42
-         }
43
-         return $hash;
39
+            $hash = hash_hmac($crypto, $text, $keyBytes);
40
+            if (false === $hash) {
41
+                throw new Exception("calculating hash_hmac failed");
42
+            }
43
+            return $hash;
44 44
     }
45 45
 
46 46
     /**
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
      * alternative to "-S064"
100 100
      */
101 101
     static function generateOCRA(string $ocraSuite,
102
-                                 string $key,
103
-                                 string $counter,
104
-                                 string $question,
105
-                                 string $password,
106
-                                 string $sessionInformation,
107
-                                 string $timeStamp) : string
102
+                                    string $key,
103
+                                    string $counter,
104
+                                    string $question,
105
+                                    string $password,
106
+                                    string $sessionInformation,
107
+                                    string $timeStamp) : string
108 108
     {
109 109
         $codeDigits = 0;
110 110
         $crypto = "";
Please login to merge, or discard this patch.
Braces   +42 added lines, -28 removed lines patch added patch discarded remove patch
@@ -122,12 +122,15 @@  discard block
 block discarded – undo
122 122
         $cryptoFunction = $components[1];
123 123
         $dataInput = strtolower($components[2]); // lower here so we can do case insensitive comparisons
124 124
         
125
-        if(stripos($cryptoFunction, "sha1")!==false)
126
-            $crypto = "sha1";
127
-        if(stripos($cryptoFunction, "sha256")!==false)
128
-            $crypto = "sha256";
129
-        if(stripos($cryptoFunction, "sha512")!==false)
130
-            $crypto = "sha512";
125
+        if(stripos($cryptoFunction, "sha1")!==false) {
126
+                    $crypto = "sha1";
127
+        }
128
+        if(stripos($cryptoFunction, "sha256")!==false) {
129
+                    $crypto = "sha256";
130
+        }
131
+        if(stripos($cryptoFunction, "sha512")!==false) {
132
+                    $crypto = "sha512";
133
+        }
131 134
         
132 135
         $codeDigits = substr($cryptoFunction, strrpos($cryptoFunction, "-")+1);
133 136
                 
@@ -135,56 +138,65 @@  discard block
 block discarded – undo
135 138
         // Counter
136 139
         if($dataInput[0] == "c" ) {
137 140
             // Fix the length of the HEX string
138
-            while(strlen($counter) < 16)
139
-                $counter = "0" . $counter;
141
+            while(strlen($counter) < 16) {
142
+                            $counter = "0" . $counter;
143
+            }
140 144
             $counterLength=8;
141 145
         }
142 146
         // Question
143 147
         if($dataInput[0] == "q" ||
144 148
                 stripos($dataInput, "-q")!==false) {
145
-            while(strlen($question) < 256)
146
-                $question = $question . "0";
149
+            while(strlen($question) < 256) {
150
+                            $question = $question . "0";
151
+            }
147 152
             $questionLength=128;
148 153
         }
149 154
 
150 155
         // Password
151 156
         if(stripos($dataInput, "psha1")!==false) {
152
-            while(strlen($password) < 40)
153
-                $password = "0" . $password;
157
+            while(strlen($password) < 40) {
158
+                            $password = "0" . $password;
159
+            }
154 160
             $passwordLength=20;
155 161
         }
156 162
     
157 163
         if(stripos($dataInput, "psha256")!==false) {
158
-            while(strlen($password) < 64)
159
-                $password = "0" . $password;
164
+            while(strlen($password) < 64) {
165
+                            $password = "0" . $password;
166
+            }
160 167
             $passwordLength=32;
161 168
         }
162 169
         
163 170
         if(stripos($dataInput, "psha512")!==false) {
164
-            while(strlen($password) < 128)
165
-                $password = "0" . $password;
171
+            while(strlen($password) < 128) {
172
+                            $password = "0" . $password;
173
+            }
166 174
             $passwordLength=64;
167 175
         }
168 176
         
169 177
         // sessionInformation
170 178
         if(stripos($dataInput, "s064") !==false) {
171
-            while(strlen($sessionInformation) < 128)
172
-                $sessionInformation = "0" . $sessionInformation;
179
+            while(strlen($sessionInformation) < 128) {
180
+                            $sessionInformation = "0" . $sessionInformation;
181
+            }
173 182
 
174 183
             $sessionInformationLength=64;
175 184
         } else if(stripos($dataInput, "s128") !==false) {
176
-            while(strlen($sessionInformation) < 256)
177
-                $sessionInformation = "0" . $sessionInformation;
185
+            while(strlen($sessionInformation) < 256) {
186
+                            $sessionInformation = "0" . $sessionInformation;
187
+            }
178 188
         
179 189
             $sessionInformationLength=128;
180 190
         } else if(stripos($dataInput, "s256") !==false) {
181
-            while(strlen($sessionInformation) < 512)
182
-                $sessionInformation = "0" . $sessionInformation;
191
+            while(strlen($sessionInformation) < 512) {
192
+                            $sessionInformation = "0" . $sessionInformation;
193
+            }
183 194
         
184 195
             $sessionInformationLength=256;
185 196
         } else if(stripos($dataInput, "s512") !==false) {
186
-            while(strlen($sessionInformation) < 128)
187
-                $sessionInformation = "0" . $sessionInformation;
197
+            while(strlen($sessionInformation) < 128) {
198
+                            $sessionInformation = "0" . $sessionInformation;
199
+            }
188 200
         
189 201
             $sessionInformationLength=64;
190 202
         } else if (stripos($dataInput, "-s") !== false ) {
@@ -196,8 +208,9 @@  discard block
 block discarded – undo
196 208
             // to prevent matching the "s" in the password input e.g. "psha1".
197 209
             // [C] | QFxx | [PH | Snnn | TG] : Challenge-Response computation
198 210
             // [C] | QFxx | [PH | TG] : Plain Signature computation
199
-            while(strlen($sessionInformation) < 128)
200
-                $sessionInformation = "0" . $sessionInformation;
211
+            while(strlen($sessionInformation) < 128) {
212
+                            $sessionInformation = "0" . $sessionInformation;
213
+            }
201 214
             
202 215
             $sessionInformationLength=64;
203 216
         }
@@ -207,8 +220,9 @@  discard block
 block discarded – undo
207 220
         // TimeStamp
208 221
         if($dataInput[0] == "t" ||
209 222
                 stripos($dataInput, "-t") !== false) {
210
-            while(strlen($timeStamp) < 16)
211
-                $timeStamp = "0" . $timeStamp;
223
+            while(strlen($timeStamp) < 16) {
224
+                            $timeStamp = "0" . $timeStamp;
225
+            }
212 226
             $timeStampLength=8;
213 227
         }
214 228
 
Please login to merge, or discard this patch.
library/tiqr/Tiqr/UserSecretStorage/Pdo.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -86,8 +86,7 @@  discard block
 block discarded – undo
86 86
             $sth = $this->handle->prepare('SELECT userid FROM ' . $this->tableName . ' WHERE userid = ?');
87 87
             $sth->execute(array($userId));
88 88
             return (false !== $sth->fetchColumn());
89
-        }
90
-        catch (Exception $e) {
89
+        } catch (Exception $e) {
91 90
             $this->logger->error('PDO error checking user exists', array('exception'=>$e, 'userId'=>$userId));
92 91
             throw ReadWriteException::fromOriginalException($e);
93 92
         }
@@ -111,8 +110,7 @@  discard block
 block discarded – undo
111 110
                 $this->logger->error(sprintf('No result getting secret for user "%s"', $userId));
112 111
                 throw new RuntimeException('User not found');
113 112
             }
114
-        }
115
-        catch (Exception $e) {
113
+        } catch (Exception $e) {
116 114
             $this->logger->error('PDO error getting user', array('exception' => $e, 'userId' => $userId));
117 115
             throw ReadWriteException::fromOriginalException($e);
118 116
         }
@@ -146,8 +144,7 @@  discard block
 block discarded – undo
146 144
                 $sth = $this->handle->prepare('INSERT INTO ' . $this->tableName . ' (secret,userid) VALUES (?,?)');
147 145
             }
148 146
             $sth->execute(array($secret, $userId));
149
-        }
150
-        catch (Exception $e) {
147
+        } catch (Exception $e) {
151 148
             $this->logger->error(
152 149
                 sprintf('Unable to persist user secret for user "%s" in user secret storage (PDO)', $userId),
153 150
                 array('exception'=>$e)
Please login to merge, or discard this patch.