@@ -196,18 +196,17 @@ |
||
196 | 196 | if ($this->roleConfiguration->roleNeedsIdentification($v)) { |
197 | 197 | if ($identified) { |
198 | 198 | $activeRoles[] = $v; |
199 | - } |
|
200 | - else { |
|
199 | + } else { |
|
201 | 200 | $inactiveRoles[] = $v; |
202 | 201 | } |
203 | - } |
|
204 | - else { |
|
202 | + } else { |
|
205 | 203 | $activeRoles[] = $v; |
206 | 204 | } |
207 | 205 | } |
208 | 206 | } |
209 | 207 | |
210 | - public function getRoleConfiguration(){ |
|
208 | + public function getRoleConfiguration() |
|
209 | + { |
|
211 | 210 | return $this->roleConfiguration; |
212 | 211 | } |
213 | 212 | } |
@@ -83,8 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | if ($siteConfiguration->getTitleBlacklistEnabled()) { |
85 | 85 | $page->setBlacklistHelper(new FakeBlacklistHelper()); |
86 | - } |
|
87 | - else { |
|
86 | + } else { |
|
88 | 87 | $page->setBlacklistHelper(new BlacklistHelper($page->getHttpHelper(), |
89 | 88 | $siteConfiguration->getMediawikiWebServiceEndpoint())); |
90 | 89 | } |
@@ -178,8 +177,7 @@ discard block |
||
178 | 177 | |
179 | 178 | if ($siteConfiguration->getIrcNotificationsEnabled()) { |
180 | 179 | $notificationsDatabase = PdoDatabase::getDatabaseConnection('notifications'); |
181 | - } |
|
182 | - else { |
|
180 | + } else { |
|
183 | 181 | // @todo federated table here? |
184 | 182 | $notificationsDatabase = $database; |
185 | 183 | } |
@@ -48,8 +48,7 @@ |
||
48 | 48 | |
49 | 49 | if ($username !== null) { |
50 | 50 | $user = User::getByUsername($username, $this->getDatabase()); |
51 | - } |
|
52 | - else { |
|
51 | + } else { |
|
53 | 52 | $user = User::getByOnWikiUsername($wikiusername, $this->getDatabase()); |
54 | 53 | } |
55 | 54 |
@@ -57,8 +57,7 @@ |
||
57 | 57 | |
58 | 58 | if ($this->getConfiguration()->getIrcNotificationsEnabled()) { |
59 | 59 | $notificationsDatabase = PdoDatabase::getDatabaseConnection('notifications'); |
60 | - } |
|
61 | - else { |
|
60 | + } else { |
|
62 | 61 | // pass through null |
63 | 62 | $notificationsDatabase = null; |
64 | 63 | } |
@@ -78,8 +78,7 @@ |
||
78 | 78 | { |
79 | 79 | if (ord($string) < 128) { |
80 | 80 | return ucfirst($string); |
81 | - } |
|
82 | - else { |
|
81 | + } else { |
|
83 | 82 | return mb_strtoupper(mb_substr($string, 0, 1)) . mb_substr($string, 1); |
84 | 83 | } |
85 | 84 | } |
@@ -63,8 +63,7 @@ |
||
63 | 63 | if ($server['HTTP_X_FORWARDED_PROTO'] === 'https') { |
64 | 64 | // Client <=> Proxy is encrypted |
65 | 65 | return true; |
66 | - } |
|
67 | - else { |
|
66 | + } else { |
|
68 | 67 | // Proxy <=> Server link unknown, Client <=> Proxy is not encrypted. |
69 | 68 | return false; |
70 | 69 | } |
@@ -44,8 +44,7 @@ |
||
44 | 44 | |
45 | 45 | if ($count > 0) { |
46 | 46 | return true; |
47 | - } |
|
48 | - else { |
|
47 | + } else { |
|
49 | 48 | return false; |
50 | 49 | } |
51 | 50 | } |
@@ -61,8 +61,7 @@ |
||
61 | 61 | $cacheEntry->save(); |
62 | 62 | |
63 | 63 | $cacheResult = $cacheEntry; |
64 | - } |
|
65 | - else { |
|
64 | + } else { |
|
66 | 65 | $data = $cacheResult->getData(); |
67 | 66 | } |
68 | 67 |
@@ -75,14 +75,12 @@ discard block |
||
75 | 75 | { |
76 | 76 | if ($this->checkIdentificationCache($onWikiName)) { |
77 | 77 | return true; |
78 | - } |
|
79 | - else { |
|
78 | + } else { |
|
80 | 79 | if ($this->isIdentifiedOnWiki($onWikiName)) { |
81 | 80 | $this->cacheIdentificationStatus($onWikiName); |
82 | 81 | |
83 | 82 | return true; |
84 | - } |
|
85 | - else { |
|
83 | + } else { |
|
86 | 84 | return false; |
87 | 85 | } |
88 | 86 | } |
@@ -187,7 +185,8 @@ discard block |
||
187 | 185 | $endpoint = $this->siteConfiguration->getMetaWikimediaWebServiceEndpoint(); |
188 | 186 | $response = $this->httpHelper->get($endpoint, $parameters); |
189 | 187 | $response = json_decode($response, true); |
190 | - } catch (CurlException $ex) { |
|
188 | + } |
|
189 | + catch (CurlException $ex) { |
|
191 | 190 | // failed getting identification status, so throw a nicer error. |
192 | 191 | $m = 'Could not contact metawiki API to determine user\' identification status. ' |
193 | 192 | . 'This is probably a transient error, so please try again.'; |