Failed Conditions
Push — newinternal ( b66232...216d62 )
by Simon
16:33 queued 06:35
created
includes/Background/BackgroundTaskBase.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -233,6 +233,9 @@
 block discarded – undo
233 233
         Logger::backgroundJobComplete($this->getDatabase(), $this->getJob());
234 234
     }
235 235
 
236
+    /**
237
+     * @param string $reason
238
+     */
236 239
     protected function markCancelled($reason = null)
237 240
     {
238 241
         $this->job->setStatus(JobQueue::STATUS_CANCELLED);
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
             throw new ApplicationLogicException('Cannot locate request');
178 178
         }
179 179
 
180
-        if($this->job->getEmailTemplate() !== null){
180
+        if ($this->job->getEmailTemplate() !== null) {
181 181
             $this->emailTemplate = EmailTemplate::getById($this->job->getEmailTemplate(), $this->getDatabase());
182 182
 
183 183
             if ($this->emailTemplate === false) {
@@ -188,15 +188,15 @@  discard block
 block discarded – undo
188 188
         $this->parameters = json_decode($this->job->getParameters());
189 189
 
190 190
         if (json_last_error() !== JSON_ERROR_NONE) {
191
-            throw new ApplicationLogicException('JSON decode: ' . json_last_error_msg());
191
+            throw new ApplicationLogicException('JSON decode: '.json_last_error_msg());
192 192
         }
193 193
 
194 194
         // Should we wait for a parent job?
195
-        if($this->job->getParent() !== null) {
195
+        if ($this->job->getParent() !== null) {
196 196
             /** @var JobQueue $parentJob */
197 197
             $parentJob = JobQueue::getById($this->job->getParent(), $this->getDatabase());
198 198
 
199
-            if($parentJob === false) {
199
+            if ($parentJob === false) {
200 200
                 $this->markFailed("Parent job could not be found");
201 201
                 return;
202 202
             }
Please login to merge, or discard this patch.
includes/Background/CreationTaskBase.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,6 +105,9 @@  discard block
 block discarded – undo
105 105
         return $this->getMediaWikiHelper()->checkAccountExists($name);
106 106
     }
107 107
 
108
+    /**
109
+     * @param string $reason
110
+     */
108 111
     protected function markFailed($reason = null)
109 112
     {
110 113
         $this->request->setStatus(RequestStatus::HOSPITAL);
@@ -116,7 +119,7 @@  discard block
 block discarded – undo
116 119
     }
117 120
 
118 121
     /**
119
-     * @param $user
122
+     * @param User $user
120 123
      *
121 124
      * @throws ApplicationLogicException
122 125
      */
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
      */
83 83
     protected abstract function getMediaWikiClient();
84 84
 
85
-    protected function getMediaWikiHelper(){
86
-        if($this->mwHelper === null) {
85
+    protected function getMediaWikiHelper() {
86
+        if ($this->mwHelper === null) {
87 87
             $this->mwHelper = new MediaWikiHelper($this->getMediaWikiClient(), $this->getSiteConfiguration());
88 88
         }
89 89
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
     protected function getCreationReason(Request $request, User $user)
94 94
     {
95
-        return 'Requested account at [[WP:ACC]], request #' . $request->getId();
95
+        return 'Requested account at [[WP:ACC]], request #'.$request->getId();
96 96
     }
97 97
 
98 98
     /**
Please login to merge, or discard this patch.
includes/DataObjects/JobQueue.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -225,7 +225,7 @@
 block discarded – undo
225 225
     }
226 226
 
227 227
     /**
228
-     * @return mixed
228
+     * @return string
229 229
      */
230 230
     public function getError()
231 231
     {
Please login to merge, or discard this patch.
includes/DataObjects/OAuthToken.php 1 patch
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     #region properties
84 84
 
85 85
     /**
86
-     * @return mixed
86
+     * @return integer
87 87
      */
88 88
     public function getUserId()
89 89
     {
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     }
100 100
 
101 101
     /**
102
-     * @return mixed
102
+     * @return string
103 103
      */
104 104
     public function getToken()
105 105
     {
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     }
116 116
 
117 117
     /**
118
-     * @return mixed
118
+     * @return string
119 119
      */
120 120
     public function getSecret()
121 121
     {
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     }
132 132
 
133 133
     /**
134
-     * @return mixed
134
+     * @return string
135 135
      */
136 136
     public function getType()
137 137
     {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     }
140 140
 
141 141
     /**
142
-     * @param mixed $type
142
+     * @param string $type
143 143
      */
144 144
     public function setType($type)
145 145
     {
Please login to merge, or discard this patch.
includes/Helpers/BotMediaWikiClient.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
 
84 84
     /**
85 85
      * @param $apiParams
86
-     * @param $method
86
+     * @param string $method
87 87
      *
88 88
      * @return mixed
89 89
      * @throws ApplicationLogicException
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         }
105 105
 
106 106
         if ($data === false) {
107
-            throw new CurlException('Curl error: ' . $this->httpHelper->getError());
107
+            throw new CurlException('Curl error: '.$this->httpHelper->getError());
108 108
         }
109 109
 
110 110
         $result = json_decode($data);
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         $response = $this->callApi($tokenParams, 'POST');
125 125
 
126 126
         if (isset($response->error)) {
127
-            throw new MediaWikiApiException($response->error->code . ': ' . $response->error->info);
127
+            throw new MediaWikiApiException($response->error->code.': '.$response->error->info);
128 128
         }
129 129
 
130 130
         $token = $response->query->tokens->logintoken;
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
         $loginResponse = $this->callApi($params, 'POST');
144 144
 
145
-        if($loginResponse->login->result == 'Success'){
145
+        if ($loginResponse->login->result == 'Success') {
146 146
             return;
147 147
         }
148 148
 
Please login to merge, or discard this patch.
includes/Helpers/Interfaces/IMediaWikiClient.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -10,5 +10,8 @@
 block discarded – undo
10 10
 
11 11
 interface IMediaWikiClient
12 12
 {
13
+    /**
14
+     * @param string $method
15
+     */
13 16
     function doApiCall($params, $method);
14 17
 }
15 18
\ No newline at end of file
Please login to merge, or discard this patch.
includes/Helpers/OAuthUserHelper.php 1 patch
Doc Comments   +13 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,6 +63,10 @@  discard block
 block discarded – undo
63 63
     private $siteConfiguration;
64 64
 
65 65
     #region Static methods
66
+
67
+    /**
68
+     * @param null|string $requestToken
69
+     */
66 70
     public static function findUserByRequestToken($requestToken, PdoDatabase $database)
67 71
     {
68 72
         $statement = $database->prepare(<<<'SQL'
@@ -119,6 +123,11 @@  discard block
 block discarded – undo
119 123
         }
120 124
     }
121 125
 
126
+    /**
127
+     * @param integer $userId
128
+     * @param null|PdoDatabase $database
129
+     * @param string $tokenType
130
+     */
122 131
     private static function runTokenCount($userId, $database, $tokenType)
123 132
     {
124 133
         if (self::$tokenCountStatement === null) {
@@ -182,7 +191,7 @@  discard block
 block discarded – undo
182 191
     /**
183 192
      * Attempts to figure out if a user is partially linked to OAuth, and therefore needs to complete the OAuth
184 193
      * procedure before configuring.
185
-     * @return bool
194
+     * @return boolean|null
186 195
      */
187 196
     public function isPartiallyLinked()
188 197
     {
@@ -245,6 +254,9 @@  discard block
 block discarded – undo
245 254
         return $this->oauthProtocolHelper->getAuthoriseUrl($token->key);
246 255
     }
247 256
 
257
+    /**
258
+     * @param null|string $verificationToken
259
+     */
248 260
     public function completeHandshake($verificationToken)
249 261
     {
250 262
         $this->getTokenStatement->execute(array(':user' => $this->user->getId(), ':type' => self::TOKEN_REQUEST));
Please login to merge, or discard this patch.
includes/Helpers/HttpHelper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
             curl_setopt($this->curlHandle, CURLOPT_SSL_VERIFYPEER, false);
34 34
         }
35 35
 
36
-        if($cookieJar !== null) {
36
+        if ($cookieJar !== null) {
37 37
             curl_setopt($this->curlHandle, CURLOPT_COOKIEFILE, $cookieJar);
38 38
             curl_setopt($this->curlHandle, CURLOPT_COOKIEJAR, $cookieJar);
39 39
         }
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     public function get($url, $parameters = null, $headers = array())
60 60
     {
61 61
         if ($parameters !== null && is_array($parameters)) {
62
-            $getString = '?' . http_build_query($parameters);
62
+            $getString = '?'.http_build_query($parameters);
63 63
             $url .= $getString;
64 64
         }
65 65
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
         if ($result === false) {
76 76
             $error = curl_error($this->curlHandle);
77
-            throw new CurlException('Remote request failed with error ' . $error);
77
+            throw new CurlException('Remote request failed with error '.$error);
78 78
         }
79 79
 
80 80
         return $result;
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
         if ($result === false) {
106 106
             $error = curl_error($this->curlHandle);
107
-            throw new CurlException('Remote request failed with error ' . $error);
107
+            throw new CurlException('Remote request failed with error '.$error);
108 108
         }
109 109
 
110 110
         return $result;
Please login to merge, or discard this patch.
includes/Helpers/SearchHelpers/SearchHelperBase.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
     {
85 85
         $this->whereClause .= $whereClauseSection;
86 86
 
87
-        $countQuery = 'SELECT /* SearchHelper */ COUNT(*) FROM ' . $this->table . ' origin ';
88
-        $countQuery .= $this->joinClause . $this->whereClause;
87
+        $countQuery = 'SELECT /* SearchHelper */ COUNT(*) FROM '.$this->table.' origin ';
88
+        $countQuery .= $this->joinClause.$this->whereClause;
89 89
 
90 90
         $query = $this->buildQuery(array('*'));
91 91
         $query .= $this->applyOrder();
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
                 throw new ApplicationLogicException('Cannot apply distinct to column fetch already using group by');
147 147
             }
148 148
 
149
-            $this->groupByClause = ' GROUP BY origin.' . $column;
149
+            $this->groupByClause = ' GROUP BY origin.'.$column;
150 150
         }
151 151
 
152 152
         $statement = $this->getData(array($column));
@@ -175,8 +175,8 @@  discard block
 block discarded – undo
175 175
      */
176 176
     public function getRecordCount(&$count)
177 177
     {
178
-        $query = 'SELECT /* SearchHelper */ COUNT(*) FROM ' . $this->table . ' origin ';
179
-        $query .= $this->joinClause . $this->whereClause;
178
+        $query = 'SELECT /* SearchHelper */ COUNT(*) FROM '.$this->table.' origin ';
179
+        $query .= $this->joinClause.$this->whereClause;
180 180
 
181 181
         $statement = $this->database->prepare($query);
182 182
         $statement->execute($this->parameterList);
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
     private function applyOrder()
224 224
     {
225 225
         if ($this->orderBy !== null) {
226
-            return ' ORDER BY ' . $this->orderBy;
226
+            return ' ORDER BY '.$this->orderBy;
227 227
         }
228 228
 
229 229
         return '';
@@ -255,11 +255,11 @@  discard block
 block discarded – undo
255 255
     {
256 256
         $colData = array();
257 257
         foreach ($columns as $c) {
258
-            $colData[] = 'origin.' . $c;
258
+            $colData[] = 'origin.'.$c;
259 259
         }
260 260
 
261
-        $query = "SELECT {$this->modifiersClause} /* SearchHelper */ " . implode(', ', $colData) . ' FROM ' . $this->table . ' origin ';
262
-        $query .= $this->joinClause . $this->whereClause . $this->groupByClause;
261
+        $query = "SELECT {$this->modifiersClause} /* SearchHelper */ ".implode(', ', $colData).' FROM '.$this->table.' origin ';
262
+        $query .= $this->joinClause.$this->whereClause.$this->groupByClause;
263 263
 
264 264
         return $query;
265 265
     }
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
         $valueCount = count($values);
282 282
 
283 283
         // Firstly, let's create a string of question marks, which will do as positional parameters.
284
-        $inSection = str_repeat('?,', $valueCount - 1) . '?';
284
+        $inSection = str_repeat('?,', $valueCount - 1).'?';
285 285
 
286 286
         $this->whereClause .= " AND {$column} IN ({$inSection})";
287 287
         $this->parameterList = array_merge($this->parameterList, $values);
Please login to merge, or discard this patch.