Test Failed
Push — dependabot/composer/newinterna... ( 091be0...c0a8dd )
by
unknown
19:18 queued 14:09
created
includes/Security/CredentialProviders/ScratchTokenCredentialProvider.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
 
63 63
         $usedToken = null;
64 64
         foreach ($scratchTokens as $scratchToken) {
65
-            if (password_verify($data, $scratchToken)){
65
+            if (password_verify($data, $scratchToken)) {
66 66
                 $usedToken = $scratchToken;
67 67
                 SessionAlert::quick("Hey, it looks like you used a scratch token to log in. Would you like to change your multi-factor authentication configuration?", 'alert-warning');
68 68
                 WebRequest::setPostLoginRedirect($this->getConfiguration()->getBaseUrl() . "/internal.php/multiFactor");
Please login to merge, or discard this patch.
includes/Security/CredentialProviders/CredentialProviderBase.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -93,7 +93,8 @@  discard block
 block discarded – undo
93 93
         return $this->configuration;
94 94
     }
95 95
 
96
-    public function deleteCredential(User $user) {
96
+    public function deleteCredential(User $user)
97
+    {
97 98
         // get this factor
98 99
         $statement = $this->database->prepare('SELECT * FROM credential WHERE user = :user AND type = :type');
99 100
         $statement->execute(array(':user' => $user->getId(), ':type' => $this->type));
@@ -114,8 +115,7 @@  discard block
 block discarded – undo
114 115
             $sql = 'UPDATE credential SET factor = factor - 1 WHERE user = :user AND factor > :factor';
115 116
             $statement = $this->database->prepare($sql);
116 117
             $statement->execute(array(':user' => $user->getId(), ':factor' => $stage));
117
-        }
118
-        else {
118
+        } else {
119 119
             // There are other auth factors at this point. Don't renumber the factors just yet.
120 120
         }
121 121
 
@@ -143,7 +143,8 @@  discard block
 block discarded – undo
143 143
      *
144 144
      * @return bool
145 145
      */
146
-    public function userIsEnrolled($userId) {
146
+    public function userIsEnrolled($userId)
147
+    {
147 148
         $cred = $this->getCredentialData($userId);
148 149
 
149 150
         return $cred !== null;
Please login to merge, or discard this patch.
includes/Security/CredentialProviders/PasswordCredentialProvider.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,7 @@
 block discarded – undo
30 30
     public function authenticate(User $user, $data)
31 31
     {
32 32
         $storedData = $this->getCredentialData($user->getId());
33
-        if($storedData === null)
34
-        {
33
+        if($storedData === null) {
35 34
             // No available credential matching these parameters
36 35
             return false;
37 36
         }
Please login to merge, or discard this patch.
includes/IdentificationVerifier.php 1 patch
Braces   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -77,14 +77,12 @@  discard block
 block discarded – undo
77 77
     {
78 78
         if ($this->checkIdentificationCache($onWikiName)) {
79 79
             return true;
80
-        }
81
-        else {
80
+        } else {
82 81
             if ($this->isIdentifiedOnWiki($onWikiName)) {
83 82
                 $this->cacheIdentificationStatus($onWikiName);
84 83
 
85 84
                 return true;
86
-            }
87
-            else {
85
+            } else {
88 86
                 return false;
89 87
             }
90 88
         }
@@ -190,7 +188,8 @@  discard block
 block discarded – undo
190 188
             $endpoint = $this->siteConfiguration->getMetaWikimediaWebServiceEndpoint();
191 189
             $response = $this->httpHelper->get($endpoint, $parameters);
192 190
             $response = json_decode($response, true);
193
-        } catch (CurlException $ex) {
191
+        }
192
+        catch (CurlException $ex) {
194 193
             // failed getting identification status, so throw a nicer error.
195 194
             $message = 'Could not contact metawiki API to determine user\' identification status. '
196 195
                 . 'This is probably a transient error, so please try again.';
Please login to merge, or discard this patch.
includes/DataObjects/OAuthIdentity.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -90,12 +90,10 @@
 block discarded – undo
90 90
 
91 91
             if ($statement->execute()) {
92 92
                 $this->id = (int)$this->dbObject->lastInsertId();
93
-            }
94
-            else {
93
+            } else {
95 94
                 throw new Exception($statement->errorInfo());
96 95
             }
97
-        }
98
-        else {
96
+        } else {
99 97
             $statement = $this->dbObject->prepare(<<<SQL
100 98
                 UPDATE oauthidentity SET
101 99
                       iss                     = :iss
Please login to merge, or discard this patch.
includes/DataObjects/Credential.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -130,8 +130,7 @@  discard block
 block discarded – undo
130 130
     {
131 131
         if ($timeout === null) {
132 132
             $this->timeout = null;
133
-        }
134
-        else {
133
+        } else {
135 134
             $this->timeout = $timeout->format('Y-m-d H:i:s');
136 135
         }
137 136
     }
@@ -188,12 +187,10 @@  discard block
 block discarded – undo
188 187
 
189 188
             if ($statement->execute()) {
190 189
                 $this->id = (int)$this->dbObject->lastInsertId();
191
-            }
192
-            else {
190
+            } else {
193 191
                 throw new Exception($statement->errorInfo());
194 192
             }
195
-        }
196
-        else {
193
+        } else {
197 194
             // update
198 195
             $statement = $this->dbObject->prepare(<<<SQL
199 196
                 UPDATE credential
Please login to merge, or discard this patch.
includes/DataObjects/JobQueue.php 1 patch
Braces   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -58,7 +58,8 @@  discard block
 block discarded – undo
58 58
     /**
59 59
      * This feels like the least bad place to put this method.
60 60
      */
61
-    public static function getTaskDescriptions() {
61
+    public static function getTaskDescriptions()
62
+    {
62 63
         return array(
63 64
             BotCreationTask::class  => 'Create account (via bot)',
64 65
             UserCreationTask::class => 'Create account (via OAuth)',
@@ -90,12 +91,10 @@  discard block
 block discarded – undo
90 91
 
91 92
             if ($statement->execute()) {
92 93
                 $this->id = (int)$this->dbObject->lastInsertId();
93
-            }
94
-            else {
94
+            } else {
95 95
                 throw new Exception($statement->errorInfo());
96 96
             }
97
-        }
98
-        else {
97
+        } else {
99 98
             // update
100 99
             $statement = $this->dbObject->prepare(<<<SQL
101 100
                 UPDATE jobqueue SET 
Please login to merge, or discard this patch.
includes/DataObjects/OAuthToken.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,12 +42,10 @@
 block discarded – undo
42 42
 
43 43
             if ($statement->execute()) {
44 44
                 $this->id = (int)$this->dbObject->lastInsertId();
45
-            }
46
-            else {
45
+            } else {
47 46
                 throw new Exception($statement->errorInfo());
48 47
             }
49
-        }
50
-        else {
48
+        } else {
51 49
             // update
52 50
             $statement = $this->dbObject->prepare(<<<SQL
53 51
                 UPDATE oauthtoken
Please login to merge, or discard this patch.
includes/DataObjects/User.php 1 patch
Braces   +8 added lines, -13 removed lines patch added patch discarded remove patch
@@ -64,12 +64,10 @@  discard block
 block discarded – undo
64 64
 
65 65
                 if ($user === false) {
66 66
                     self::$currentUser = new CommunityUser();
67
-                }
68
-                else {
67
+                } else {
69 68
                     self::$currentUser = $user;
70 69
                 }
71
-            }
72
-            else {
70
+            } else {
73 71
                 $anonymousCoward = new CommunityUser();
74 72
 
75 73
                 self::$currentUser = $anonymousCoward;
@@ -203,12 +201,10 @@  discard block
 block discarded – undo
203 201
 
204 202
             if ($statement->execute()) {
205 203
                 $this->id = (int)$this->dbObject->lastInsertId();
206
-            }
207
-            else {
204
+            } else {
208 205
                 throw new Exception($statement->errorInfo());
209 206
             }
210
-        }
211
-        else {
207
+        } else {
212 208
             // update
213 209
             $statement = $this->dbObject->prepare(<<<SQL
214 210
 				UPDATE `user` SET 
@@ -533,12 +529,10 @@  discard block
 block discarded – undo
533 529
         if ($this->forceidentified === 0 || $this->forceidentified === "0") {
534 530
             // User forced to unidentified in the database.
535 531
             return false;
536
-        }
537
-        elseif ($this->forceidentified === 1 || $this->forceidentified === "1") {
532
+        } elseif ($this->forceidentified === 1 || $this->forceidentified === "1") {
538 533
             // User forced to identified in the database.
539 534
             return true;
540
-        }
541
-        else {
535
+        } else {
542 536
             // User not forced to any particular identified status; consult IdentificationVerifier
543 537
             return $iv->isUserIdentified($this->getOnWikiName());
544 538
         }
@@ -549,7 +543,8 @@  discard block
 block discarded – undo
549 543
      *
550 544
      * @return bool|null
551 545
      */
552
-    public function getForceIdentified() {
546
+    public function getForceIdentified()
547
+    {
553 548
         return $this->forceidentified;
554 549
     }
555 550
 
Please login to merge, or discard this patch.