@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | try { |
| 28 | 28 | $then = new DateTime($input); |
| 29 | 29 | } |
| 30 | - catch(Exception $ex) { |
|
| 30 | + catch (Exception $ex) { |
|
| 31 | 31 | return $input; |
| 32 | 32 | } |
| 33 | 33 | } |
@@ -55,25 +55,25 @@ discard block |
||
| 55 | 55 | $pluralise = false; |
| 56 | 56 | } |
| 57 | 57 | elseif ($secs > 10 && $secs < $minuteCut) { |
| 58 | - $output = round($secs / $second) . " second"; |
|
| 58 | + $output = round($secs / $second)." second"; |
|
| 59 | 59 | } |
| 60 | 60 | elseif ($secs >= $minuteCut && $secs < $hourCut) { |
| 61 | - $output = round($secs / $minute) . " minute"; |
|
| 61 | + $output = round($secs / $minute)." minute"; |
|
| 62 | 62 | } |
| 63 | 63 | elseif ($secs >= $hourCut && $secs < $dayCut) { |
| 64 | - $output = round($secs / $hour) . " hour"; |
|
| 64 | + $output = round($secs / $hour)." hour"; |
|
| 65 | 65 | } |
| 66 | 66 | elseif ($secs >= $dayCut && $secs < $weekCut) { |
| 67 | - $output = round($secs / $day) . " day"; |
|
| 67 | + $output = round($secs / $day)." day"; |
|
| 68 | 68 | } |
| 69 | 69 | elseif ($secs >= $weekCut && $secs < $monthCut) { |
| 70 | - $output = round($secs / $week) . " week"; |
|
| 70 | + $output = round($secs / $week)." week"; |
|
| 71 | 71 | } |
| 72 | 72 | elseif ($secs >= $monthCut && $secs < $yearCut) { |
| 73 | - $output = round($secs / $month) . " month"; |
|
| 73 | + $output = round($secs / $month)." month"; |
|
| 74 | 74 | } |
| 75 | 75 | elseif ($secs >= $yearCut && $secs < $year * 10) { |
| 76 | - $output = round($secs / $year) . " year"; |
|
| 76 | + $output = round($secs / $year)." year"; |
|
| 77 | 77 | } |
| 78 | 78 | else { |
| 79 | 79 | $output = "a long time ago"; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | if ($pluralise) { |
| 84 | - $output = (substr($output, 0, 2) <> "1 ") ? $output . "s ago" : $output . " ago"; |
|
| 84 | + $output = (substr($output, 0, 2) <> "1 ") ? $output."s ago" : $output." ago"; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | return $output; |
@@ -177,7 +177,7 @@ discard block |
||
| 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) { |
@@ -185,20 +185,20 @@ discard block |
||
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - if($this->job->getParameters() !== null) { |
|
| 188 | + if ($this->job->getParameters() !== null) { |
|
| 189 | 189 | $this->parameters = json_decode($this->job->getParameters()); |
| 190 | 190 | |
| 191 | 191 | if (json_last_error() !== JSON_ERROR_NONE) { |
| 192 | - throw new ApplicationLogicException('JSON decode: ' . json_last_error_msg()); |
|
| 192 | + throw new ApplicationLogicException('JSON decode: '.json_last_error_msg()); |
|
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | // Should we wait for a parent job? |
| 197 | - if($this->job->getParent() !== null) { |
|
| 197 | + if ($this->job->getParent() !== null) { |
|
| 198 | 198 | /** @var JobQueue $parentJob */ |
| 199 | 199 | $parentJob = JobQueue::getById($this->job->getParent(), $this->getDatabase()); |
| 200 | 200 | |
| 201 | - if($parentJob === false) { |
|
| 201 | + if ($parentJob === false) { |
|
| 202 | 202 | $this->markFailed("Parent job could not be found"); |
| 203 | 203 | return; |
| 204 | 204 | } |
@@ -147,7 +147,7 @@ |
||
| 147 | 147 | $oauth = new OAuthUserHelper($user, $database, $this->getOAuthProtocolHelper(), $this->getSiteConfiguration()); |
| 148 | 148 | $this->assign('oauth', $oauth); |
| 149 | 149 | |
| 150 | - if($user->getForceIdentified() === null) { |
|
| 150 | + if ($user->getForceIdentified() === null) { |
|
| 151 | 151 | $idVerifier = new IdentificationVerifier($this->getHttpHelper(), $this->getSiteConfiguration(), $this->getDatabase()); |
| 152 | 152 | $this->assign('identificationStatus', $idVerifier->isUserIdentified($user->getOnWikiName()) ? 'detected' : 'missing'); |
| 153 | 153 | } else { |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | protected function main() |
| 21 | 21 | { |
| 22 | - if(WebRequest::wasPosted()) { |
|
| 22 | + if (WebRequest::wasPosted()) { |
|
| 23 | 23 | Session::destroy(); |
| 24 | 24 | $this->redirect("login"); |
| 25 | 25 | return; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | // Create a task. |
| 79 | 79 | $taskName = $job->getTask(); |
| 80 | 80 | |
| 81 | - if(!class_exists($taskName)) { |
|
| 81 | + if (!class_exists($taskName)) { |
|
| 82 | 82 | throw new ApplicationLogicException('Job task does not exist'); |
| 83 | 83 | } |
| 84 | 84 | |
@@ -132,6 +132,6 @@ discard block |
||
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | public static function errorHandler($errno, $errstr, $errfile, $errline) { |
| 135 | - throw new Exception($errfile . "@" . $errline . ": " . $errstr); |
|
| 135 | + throw new Exception($errfile."@".$errline.": ".$errstr); |
|
| 136 | 136 | } |
| 137 | 137 | } |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | |
| 27 | 27 | $dataset = []; |
| 28 | 28 | foreach ($templates as $tpl) { |
| 29 | - if($tpl->getJsquestion() != "") { |
|
| 29 | + if ($tpl->getJsquestion() != "") { |
|
| 30 | 30 | $dataset[$tpl->getId()] = $tpl->getJsquestion(); |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -133,7 +133,7 @@ |
||
| 133 | 133 | if ($reservationId !== 0 && $reservationId !== null) { |
| 134 | 134 | if ($currentUser->getId() !== $reservationId) { |
| 135 | 135 | SessionAlert::error("Request is reserved by someone else."); |
| 136 | - $this->redirect('/viewRequest', null, ['id' => $request->getId()] ); |
|
| 136 | + $this->redirect('/viewRequest', null, ['id' => $request->getId()]); |
|
| 137 | 137 | return true; |
| 138 | 138 | } |
| 139 | 139 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $constructedPolicy = "Content-Security-Policy{$reportOnly}: "; |
| 63 | 63 | |
| 64 | 64 | foreach ($this->policy as $item => $values) { |
| 65 | - $constructedPolicy .= $item . ' '; |
|
| 65 | + $constructedPolicy .= $item.' '; |
|
| 66 | 66 | $policyIsSet = false; |
| 67 | 67 | |
| 68 | 68 | if (count($values) > 0) { |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | break; |
| 87 | 87 | default: |
| 88 | 88 | $policyIsSet = true; |
| 89 | - $constructedPolicy .= $value . ' '; |
|
| 89 | + $constructedPolicy .= $value.' '; |
|
| 90 | 90 | break; |
| 91 | 91 | } |
| 92 | 92 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | if ($this->configuration->getCspReportUri() !== null) { |
| 106 | - $constructedPolicy .= 'report-uri ' . $this->configuration->getCspReportUri(); |
|
| 106 | + $constructedPolicy .= 'report-uri '.$this->configuration->getCspReportUri(); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | return $constructedPolicy; |