Test Failed
Pull Request — develop (#53)
by Pieter van der
03:03
created
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/OATH/OCRA.php 1 patch
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.
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/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/UserSecretStorage/File.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,6 @@
 block discarded – undo
35 35
  * Supported options:
36 36
  * path : Path to the directory where the user data is stored
37 37
  *
38
-
39 38
  */
40 39
 class Tiqr_UserSecretStorage_File implements Tiqr_UserSecretStorage_Interface
41 40
 {
Please login to merge, or discard this patch.
library/tiqr/Tiqr/UserSecretStorage/Pdo.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,6 @@
 block discarded – undo
42 42
     userid varchar(30) NOT NULL UNIQUE,
43 43
     secret varchar(128),
44 44
 );
45
-
46 45
  * @see Tiqr_UserSecretStorage::getSecretStorage()
47 46
  * @see Tiqr_UserSecretStorage_Interface
48 47
  *
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
@@ -59,7 +59,6 @@
 block discarded – undo
59 59
 );
60 60
 
61 61
 CREATE INDEX IF NOT EXISTS index_tiqrstate_expire ON tiqrstate (expire);
62
-
63 62
  * @see Tiqr_StateStorage::getStorage()
64 63
  * @see Tiqr_StateStorage_StateStorageInterface
65 64
  *
Please login to merge, or discard this patch.
library/tiqr/Tiqr/UserSecretStorage/UserSecretStorageTrait.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
         if ($prefix === $this->encryption->get_type()) {
55 55
             // Decrypt the secret if it is prefixed with the current encryption type
56 56
             // Remove the encryption type prefix before decrypting
57
-           return $this->encryption->decrypt( substr($encryptedSecret, $pos+1) );
57
+            return $this->encryption->decrypt( substr($encryptedSecret, $pos+1) );
58 58
         }
59 59
 
60 60
         // Check the decryption array for the encryption type to see if there is an encryption
Please login to merge, or discard this patch.