Passed
Push — master ( 35fb8a...2dccb2 )
by Pieter van der
05:32 queued 14s
created
library/tiqr/Tiqr/UserStorage/GenericStore.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     public function createUser(string $userId, string $displayName) : void
61 61
     {
62 62
         $user = array("userId"=>$userId,
63
-                      "displayName"=>$displayName);
63
+                        "displayName"=>$displayName);
64 64
         $this->_saveUser($userId, $user);
65 65
     }
66 66
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     {
91 91
         if ($data = $this->_loadUser($userId)) {
92 92
             if (isset($data["notificationType"])) {
93
-               return $data["notificationType"];
93
+                return $data["notificationType"];
94 94
             }
95 95
         }
96 96
         return '';
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     {
114 114
         if ($data = $this->_loadUser($userId)) {
115 115
             if (isset($data["notificationAddress"])) {
116
-               return $data["notificationAddress"];
116
+                return $data["notificationAddress"];
117 117
             }
118 118
         }
119 119
         $this->logger->info('Unable to find notification address for user');
Please login to merge, or discard this patch.
library/tiqr/Tiqr/StateStorage/File.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,8 +54,8 @@
 block discarded – undo
54 54
         }
55 55
 
56 56
         $envelope = array("expire"=>$expire,
57
-                          "createdAt"=>time(),
58
-                          "value"=>$value);
57
+                            "createdAt"=>time(),
58
+                            "value"=>$value);
59 59
         $filename = $this->getFilenameByKey($key);
60 60
         
61 61
         if (!file_put_contents($filename, serialize($envelope))) {
Please login to merge, or discard this patch.
library/tiqr/Tiqr/StateStorage/Pdo.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,6 @@
 block discarded – undo
21 21
  * 
22 22
  * 
23 23
  * Create SQL table (MySQL):
24
-
25 24
  * CREATE TABLE IF NOT EXISTS tiqrstate (
26 25
     key varchar(255) PRIMARY KEY,
27 26
     expire BIGINT,
Please login to merge, or discard this patch.
library/tiqr/Tiqr/Service.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -571,17 +571,17 @@  discard block
 block discarded – undo
571 571
         }
572 572
 
573 573
         $metadata = array("service"=>
574
-                               array("displayName"       => $this->_name,
575
-                                     "identifier"        => $this->_identifier,
576
-                                     "logoUrl"           => $this->_logoUrl,
577
-                                     "infoUrl"           => $this->_infoUrl,
578
-                                     "authenticationUrl" => $authenticationUrl,
579
-                                     "ocraSuite"         => $this->_ocraSuite,
580
-                                     "enrollmentUrl"     => $enrollmentUrl
581
-                               ),
582
-                          "identity"=>
583
-                               array("identifier" =>$data["userId"],
584
-                                     "displayName"=>$data["displayName"]));
574
+                                array("displayName"       => $this->_name,
575
+                                        "identifier"        => $this->_identifier,
576
+                                        "logoUrl"           => $this->_logoUrl,
577
+                                        "infoUrl"           => $this->_infoUrl,
578
+                                        "authenticationUrl" => $authenticationUrl,
579
+                                        "ocraSuite"         => $this->_ocraSuite,
580
+                                        "enrollmentUrl"     => $enrollmentUrl
581
+                                ),
582
+                            "identity"=>
583
+                                array("identifier" =>$data["userId"],
584
+                                        "displayName"=>$data["displayName"]));
585 585
 
586 586
         $this->_unsetStateValue(self::PREFIX_ENROLLMENT, $enrollmentKey);
587 587
 
@@ -611,28 +611,28 @@  discard block
 block discarded – undo
611 611
      */
612 612
     public function getEnrollmentSecret(string $enrollmentKey): string
613 613
     {
614
-         $data = $this->_getStateValue(self::PREFIX_ENROLLMENT, $enrollmentKey);
615
-         if (!is_array($data)) {
616
-             $this->logger->error('getEnrollmentSecret: enrollment key not found');
617
-             throw new RuntimeException('enrollment key not found');
618
-         }
619
-         $userId = $data["userId"] ?? NULL;
620
-         $sessionId = $data["sessionId"] ?? NULL;
621
-         if (!is_string($userId) || !(is_string($sessionId))) {
622
-             throw new RuntimeException('getEnrollmentSecret: invalid enrollment data');
623
-         }
624
-         $enrollmentData = [
625
-             "userId" => $userId,
626
-             "sessionId" => $sessionId
627
-         ];
628
-         $enrollmentSecret = $this->_uniqueSessionKey();
629
-         $this->_setStateValue(
630
-             self::PREFIX_ENROLLMENT_SECRET,
631
-             $enrollmentSecret,
632
-             $enrollmentData,
633
-             self::ENROLLMENT_EXPIRE
634
-         );
635
-         return $enrollmentSecret;
614
+            $data = $this->_getStateValue(self::PREFIX_ENROLLMENT, $enrollmentKey);
615
+            if (!is_array($data)) {
616
+                $this->logger->error('getEnrollmentSecret: enrollment key not found');
617
+                throw new RuntimeException('enrollment key not found');
618
+            }
619
+            $userId = $data["userId"] ?? NULL;
620
+            $sessionId = $data["sessionId"] ?? NULL;
621
+            if (!is_string($userId) || !(is_string($sessionId))) {
622
+                throw new RuntimeException('getEnrollmentSecret: invalid enrollment data');
623
+            }
624
+            $enrollmentData = [
625
+                "userId" => $userId,
626
+                "sessionId" => $sessionId
627
+            ];
628
+            $enrollmentSecret = $this->_uniqueSessionKey();
629
+            $this->_setStateValue(
630
+                self::PREFIX_ENROLLMENT_SECRET,
631
+                $enrollmentSecret,
632
+                $enrollmentData,
633
+                self::ENROLLMENT_EXPIRE
634
+            );
635
+            return $enrollmentSecret;
636 636
     }
637 637
 
638 638
     /**
Please login to merge, or discard this patch.
library/tiqr/Tiqr/UserStorage/Pdo.php 1 patch
Indentation   -2 removed lines patch added patch discarded remove patch
@@ -30,13 +30,11 @@
 block discarded – undo
30 30
     notificationtype varchar(10),
31 31
     notificationaddress varchar(64)
32 32
 );
33
-
34 33
  *
35 34
  * In version 3.0 the format of the tmpblocktimestamp was changed from a datetime format to an integer.
36 35
  * Because it holds a unix timestamp a 64-bit (8-byte) integer. To upgrade the user table to the new format use:
37 36
 
38 37
 ALTER TABLE user MODIFY tmpblocktimestamp BIGINT;
39
-
40 38
  */
41 39
 
42 40
 use Psr\Log\LoggerInterface;
Please login to merge, or discard this patch.