@@ -41,8 +41,9 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | public static function getOcraService(string $type="tiqr", array $options=array(), LoggerInterface $logger=null) |
| 43 | 43 | { |
| 44 | - if (!$logger) |
|
| 45 | - $logger=new \Psr\Log\NullLogger(); |
|
| 44 | + if (!$logger) { |
|
| 45 | + $logger=new \Psr\Log\NullLogger(); |
|
| 46 | + } |
|
| 46 | 47 | |
| 47 | 48 | switch ($type) { |
| 48 | 49 | case "tiqr": |
@@ -47,8 +47,9 @@ |
||
| 47 | 47 | */ |
| 48 | 48 | public static function getStorage($type="dummy", $options=array(), LoggerInterface $logger=null) |
| 49 | 49 | { |
| 50 | - if (!$logger) |
|
| 51 | - $logger=new \Psr\Log\NullLogger(); |
|
| 50 | + if (!$logger) { |
|
| 51 | + $logger=new \Psr\Log\NullLogger(); |
|
| 52 | + } |
|
| 52 | 53 | |
| 53 | 54 | switch ($type) { |
| 54 | 55 | case "dummy": |
@@ -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 | } |
@@ -347,8 +346,9 @@ discard block |
||
| 347 | 346 | case 'APNS': |
| 348 | 347 | case 'APNS_DIRECT': |
| 349 | 348 | $apns_version = $this->_options['apns.version'] ?? 2; |
| 350 | - if ($apns_version !=2) |
|
| 351 | - throw new InvalidArgumentException("Unsupported APNS version '$apns_version'"); |
|
| 349 | + if ($apns_version !=2) { |
|
| 350 | + throw new InvalidArgumentException("Unsupported APNS version '$apns_version'"); |
|
| 351 | + } |
|
| 352 | 352 | $message = new Tiqr_Message_APNS2($this->_options, $this->logger); |
| 353 | 353 | break; |
| 354 | 354 | |
@@ -514,7 +514,9 @@ discard block |
||
| 514 | 514 | $sessionId = session_id(); |
| 515 | 515 | } |
| 516 | 516 | $status = $this->_getStateValue(self::PREFIX_ENROLLMENT_STATUS, $sessionId); |
| 517 | - if (is_null($status)) return self::ENROLLMENT_STATUS_IDLE; |
|
| 517 | + if (is_null($status)) { |
|
| 518 | + return self::ENROLLMENT_STATUS_IDLE; |
|
| 519 | + } |
|
| 518 | 520 | return $status; |
| 519 | 521 | } |
| 520 | 522 | |
@@ -871,8 +873,7 @@ discard block |
||
| 871 | 873 | |
| 872 | 874 | try { |
| 873 | 875 | return $this->_getStateValue("authenticated_", $sessionId); |
| 874 | - } |
|
| 875 | - catch (Exception $e) { |
|
| 876 | + } catch (Exception $e) { |
|
| 876 | 877 | $this->logger->error('getAuthenticatedUser failed', array('exception'=>$e)); |
| 877 | 878 | return NULL; |
| 878 | 879 | } |