@@ -42,8 +42,7 @@ discard block |
||
| 42 | 42 | if (WebRequest::wasPosted()) { |
| 43 | 43 | $request = $this->createNewRequest(null); |
| 44 | 44 | $this->handleFormPost($request); |
| 45 | - } |
|
| 46 | - else { |
|
| 45 | + } else { |
|
| 47 | 46 | $this->requestClientHints(); |
| 48 | 47 | $this->handleFormRefilling(); |
| 49 | 48 | |
@@ -77,8 +76,7 @@ discard block |
||
| 77 | 76 | if (WebRequest::wasPosted()) { |
| 78 | 77 | $request = $this->createNewRequest($form); |
| 79 | 78 | $this->handleFormPost($request); |
| 80 | - } |
|
| 81 | - else { |
|
| 79 | + } else { |
|
| 82 | 80 | $this->requestClientHints(); |
| 83 | 81 | $this->handleFormRefilling(); |
| 84 | 82 | |
@@ -106,8 +104,7 @@ discard block |
||
| 106 | 104 | |
| 107 | 105 | if ($form === null) { |
| 108 | 106 | $domain = 1; |
| 109 | - } |
|
| 110 | - else { |
|
| 107 | + } else { |
|
| 111 | 108 | $domain = $form->getDomain(); |
| 112 | 109 | $request->setOriginForm($form->getId()); |
| 113 | 110 | } |
@@ -285,8 +282,7 @@ discard block |
||
| 285 | 282 | if ($this->getSiteConfiguration()->getEmailConfirmationEnabled()) { |
| 286 | 283 | $this->saveAsEmailConfirmation($request, $comment); |
| 287 | 284 | $this->savePrivateData($request); |
| 288 | - } |
|
| 289 | - else { |
|
| 285 | + } else { |
|
| 290 | 286 | $this->saveWithoutEmailConfirmation($request, $comment); |
| 291 | 287 | $this->savePrivateData($request); |
| 292 | 288 | } |
@@ -320,11 +316,10 @@ discard block |
||
| 320 | 316 | |
| 321 | 317 | private function savePrivateData(Request $request) |
| 322 | 318 | { |
| 323 | - foreach ($this->getSiteConfiguration()->getAcceptClientHints() as $header) |
|
| 324 | - { |
|
| 319 | + foreach ($this->getSiteConfiguration()->getAcceptClientHints() as $header) { |
|
| 325 | 320 | $value = WebRequest::httpHeader($header); |
| 326 | 321 | |
| 327 | - if($value === null){ |
|
| 322 | + if($value === null) { |
|
| 328 | 323 | continue; |
| 329 | 324 | } |
| 330 | 325 | |
@@ -101,8 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | SessionAlert::success('Comment has been saved successfully'); |
| 103 | 103 | $this->redirectBack($comment->getRequest()); |
| 104 | - } |
|
| 105 | - else { |
|
| 104 | + } else { |
|
| 106 | 105 | $this->assignCSRFToken(); |
| 107 | 106 | $this->assign('comment', $comment); |
| 108 | 107 | $this->assign('request', $request); |
@@ -171,8 +170,7 @@ discard block |
||
| 171 | 170 | |
| 172 | 171 | if ($source == 'flagged') { |
| 173 | 172 | $this->redirect('flaggedComments'); |
| 174 | - } |
|
| 175 | - else { |
|
| 173 | + } else { |
|
| 176 | 174 | $this->redirect('viewRequest', null, array('id' => $requestId)); |
| 177 | 175 | } |
| 178 | 176 | } |
@@ -66,8 +66,7 @@ discard block |
||
| 66 | 66 | if ($server['HTTP_X_FORWARDED_PROTO'] === 'https') { |
| 67 | 67 | // Client <=> Proxy is encrypted |
| 68 | 68 | return true; |
| 69 | - } |
|
| 70 | - else { |
|
| 69 | + } else { |
|
| 71 | 70 | // Proxy <=> Server link unknown, Client <=> Proxy is not encrypted. |
| 72 | 71 | return false; |
| 73 | 72 | } |
@@ -635,8 +634,7 @@ discard block |
||
| 635 | 634 | |
| 636 | 635 | if (isset($cookie['request_table_sort'])) { |
| 637 | 636 | return explode('/', $cookie['request_table_sort'], 2); |
| 638 | - } |
|
| 639 | - else { |
|
| 637 | + } else { |
|
| 640 | 638 | return ['id', 'asc']; |
| 641 | 639 | } |
| 642 | 640 | } |
@@ -59,8 +59,7 @@ |
||
| 59 | 59 | if (count($pathInfo) === 3 && $pathInfo[0] === 'r') { |
| 60 | 60 | // this request should be routed to the dynamic request form handler |
| 61 | 61 | return [PageRequestAccount::class, 'dynamic']; |
| 62 | - } |
|
| 63 | - else { |
|
| 62 | + } else { |
|
| 64 | 63 | return parent::getRouteFromPath($pathInfo); |
| 65 | 64 | } |
| 66 | 65 | } |
@@ -228,8 +228,7 @@ |
||
| 228 | 228 | foreach ($req->fields as $name => $data) { |
| 229 | 229 | if ($data->type === 'checkbox') { |
| 230 | 230 | $checkboxFields[] = $name; |
| 231 | - } |
|
| 232 | - else { |
|
| 231 | + } else { |
|
| 233 | 232 | $requiredFields[] = $name; |
| 234 | 233 | } |
| 235 | 234 | } |
@@ -72,12 +72,10 @@ discard block |
||
| 72 | 72 | $userinfoResult = $this->callApi(array('action' => 'query', 'meta' => 'userinfo'), 'GET'); |
| 73 | 73 | if (isset($userinfoResult->query->userinfo->anon)) { |
| 74 | 74 | throw new MediaWikiApiException('Unable to log in.'); |
| 75 | - } |
|
| 76 | - else { |
|
| 75 | + } else { |
|
| 77 | 76 | $this->knownLoggedIn = true; |
| 78 | 77 | } |
| 79 | - } |
|
| 80 | - else { |
|
| 78 | + } else { |
|
| 81 | 79 | $this->knownLoggedIn = true; |
| 82 | 80 | } |
| 83 | 81 | } |
@@ -96,11 +94,9 @@ discard block |
||
| 96 | 94 | |
| 97 | 95 | if ($method == 'GET') { |
| 98 | 96 | $data = $this->httpHelper->get($this->mediawikiWebServiceEndpoint, $apiParams); |
| 99 | - } |
|
| 100 | - elseif ($method == 'POST') { |
|
| 97 | + } elseif ($method == 'POST') { |
|
| 101 | 98 | $data = $this->httpHelper->post($this->mediawikiWebServiceEndpoint, $apiParams); |
| 102 | - } |
|
| 103 | - else { |
|
| 99 | + } else { |
|
| 104 | 100 | throw new ApplicationLogicException('Unsupported HTTP Method'); |
| 105 | 101 | } |
| 106 | 102 | |
@@ -74,8 +74,7 @@ |
||
| 74 | 74 | |
| 75 | 75 | if ($domain !== null) { |
| 76 | 76 | $log->setDomain($domain); |
| 77 | - } |
|
| 78 | - elseif (method_exists($object, 'getDomain')) { |
|
| 77 | + } elseif (method_exists($object, 'getDomain')) { |
|
| 79 | 78 | $log->setDomain($object->getDomain()); |
| 80 | 79 | } |
| 81 | 80 | |
@@ -38,8 +38,7 @@ |
||
| 38 | 38 | |
| 39 | 39 | if ($domain === null) { |
| 40 | 40 | $helper->whereClause .= ' AND domain IS NULL'; |
| 41 | - } |
|
| 42 | - else { |
|
| 41 | + } else { |
|
| 43 | 42 | $helper->whereClause .= ' AND coalesce(domain, ?) = ?'; |
| 44 | 43 | $helper->parameterList[] = $domain; |
| 45 | 44 | $helper->parameterList[] = $domain; |
@@ -77,14 +77,12 @@ |
||
| 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 | } |