@@ -287,8 +287,7 @@ discard block |
||
287 | 287 | if (isset($options['ocraservice']) && $options['ocraservice']['type'] != 'tiqr') { |
288 | 288 | $options['ocraservice']['ocra.suite'] = $this->_ocraSuite; |
289 | 289 | $this->_ocraService = Tiqr_OcraService::getOcraService($options['ocraservice']['type'], $options['ocraservice'], $logger); |
290 | - } |
|
291 | - else { // Create default ocraservice |
|
290 | + } else { // Create default ocraservice |
|
292 | 291 | $this->_ocraService = Tiqr_OcraService::getOcraService('tiqr', array('ocra.suite' => $this->_ocraSuite), $logger); |
293 | 292 | } |
294 | 293 | } |
@@ -511,7 +510,9 @@ discard block |
||
511 | 510 | $sessionId = session_id(); |
512 | 511 | } |
513 | 512 | $status = $this->_getStateValue(self::PREFIX_ENROLLMENT_STATUS, $sessionId); |
514 | - if (is_null($status)) return self::ENROLLMENT_STATUS_IDLE; |
|
513 | + if (is_null($status)) { |
|
514 | + return self::ENROLLMENT_STATUS_IDLE; |
|
515 | + } |
|
515 | 516 | return $status; |
516 | 517 | } |
517 | 518 | |
@@ -868,8 +869,7 @@ discard block |
||
868 | 869 | |
869 | 870 | try { |
870 | 871 | return $this->_getStateValue("authenticated_", $sessionId); |
871 | - } |
|
872 | - catch (Exception $e) { |
|
872 | + } catch (Exception $e) { |
|
873 | 873 | $this->logger->error('getAuthenticatedUser failed', array('exception'=>$e)); |
874 | 874 | return NULL; |
875 | 875 | } |
@@ -110,8 +110,7 @@ discard block |
||
110 | 110 | throw new RuntimeException('Unexpected return type'); |
111 | 111 | } |
112 | 112 | return $res; |
113 | - } |
|
114 | - catch (Exception $e) { |
|
113 | + } catch (Exception $e) { |
|
115 | 114 | $this->logger->error('PDO error getting user', array('exception' => $e, 'userId' => $userId, 'columnName'=>$columnName)); |
116 | 115 | throw ReadWriteException::fromOriginalException($e); |
117 | 116 | } |
@@ -149,8 +148,7 @@ discard block |
||
149 | 148 | throw new RuntimeException('Unexpected return type'); |
150 | 149 | } |
151 | 150 | return (int)$res; |
152 | - } |
|
153 | - catch (Exception $e) { |
|
151 | + } catch (Exception $e) { |
|
154 | 152 | $this->logger->error('PDO error getting user', array('exception' => $e, 'userId' => $userId, 'columnName'=>$columnName)); |
155 | 153 | throw ReadWriteException::fromOriginalException($e); |
156 | 154 | } |
@@ -177,8 +175,7 @@ discard block |
||
177 | 175 | throw new RuntimeException('User not found'); |
178 | 176 | } |
179 | 177 | } |
180 | - } |
|
181 | - catch (Exception $e) { |
|
178 | + } catch (Exception $e) { |
|
182 | 179 | $this->logger->error('PDO error updating user', array('exception' => $e, 'userId' => $userId, 'columnName'=>$columnName)); |
183 | 180 | throw ReadWriteException::fromOriginalException($e); |
184 | 181 | } |
@@ -205,8 +202,7 @@ discard block |
||
205 | 202 | throw new RuntimeException('User not found'); |
206 | 203 | } |
207 | 204 | } |
208 | - } |
|
209 | - catch (Exception $e) { |
|
205 | + } catch (Exception $e) { |
|
210 | 206 | $this->logger->error('PDO error updating user', array('exception' => $e, 'userId' => $userId, 'columnName'=>$columnName)); |
211 | 207 | throw ReadWriteException::fromOriginalException($e); |
212 | 208 | } |
@@ -223,8 +219,7 @@ discard block |
||
223 | 219 | try { |
224 | 220 | $sth = $this->handle->prepare("INSERT INTO ".$this->tablename." (displayname,userid) VALUES (?,?)"); |
225 | 221 | $sth->execute(array($displayName, $userId)); |
226 | - } |
|
227 | - catch (Exception $e) { |
|
222 | + } catch (Exception $e) { |
|
228 | 223 | $this->logger->error(sprintf('Error creating user "%s"', $userId), array('exception'=>$e)); |
229 | 224 | throw new ReadWriteException('The user could not be saved in the user storage (PDO)'); |
230 | 225 | } |
@@ -239,8 +234,7 @@ discard block |
||
239 | 234 | $sth = $this->handle->prepare("SELECT userid FROM ".$this->tablename." WHERE userid = ?"); |
240 | 235 | $sth->execute(array($userId)); |
241 | 236 | return (false !== $sth->fetchColumn()); |
242 | - } |
|
243 | - catch (Exception $e) { |
|
237 | + } catch (Exception $e) { |
|
244 | 238 | $this->logger->error('PDO error checking user exists', array('exception'=>$e, 'userId'=>$userId)); |
245 | 239 | throw ReadWriteException::fromOriginalException($e); |
246 | 240 | } |