@@ -50,25 +50,25 @@ discard block |
||
| 50 | 50 | $pluralise = false; |
| 51 | 51 | } |
| 52 | 52 | elseif ($secs > 10 && $secs < $minuteCut) { |
| 53 | - $output = round($secs / $second) . " second"; |
|
| 53 | + $output = round($secs / $second)." second"; |
|
| 54 | 54 | } |
| 55 | 55 | elseif ($secs >= $minuteCut && $secs < $hourCut) { |
| 56 | - $output = round($secs / $minute) . " minute"; |
|
| 56 | + $output = round($secs / $minute)." minute"; |
|
| 57 | 57 | } |
| 58 | 58 | elseif ($secs >= $hourCut && $secs < $dayCut) { |
| 59 | - $output = round($secs / $hour) . " hour"; |
|
| 59 | + $output = round($secs / $hour)." hour"; |
|
| 60 | 60 | } |
| 61 | 61 | elseif ($secs >= $dayCut && $secs < $weekCut) { |
| 62 | - $output = round($secs / $day) . " day"; |
|
| 62 | + $output = round($secs / $day)." day"; |
|
| 63 | 63 | } |
| 64 | 64 | elseif ($secs >= $weekCut && $secs < $monthCut) { |
| 65 | - $output = round($secs / $week) . " week"; |
|
| 65 | + $output = round($secs / $week)." week"; |
|
| 66 | 66 | } |
| 67 | 67 | elseif ($secs >= $monthCut && $secs < $yearCut) { |
| 68 | - $output = round($secs / $month) . " month"; |
|
| 68 | + $output = round($secs / $month)." month"; |
|
| 69 | 69 | } |
| 70 | 70 | elseif ($secs >= $yearCut && $secs < $year * 10) { |
| 71 | - $output = round($secs / $year) . " year"; |
|
| 71 | + $output = round($secs / $year)." year"; |
|
| 72 | 72 | } |
| 73 | 73 | else { |
| 74 | 74 | $output = "a long time ago"; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | if ($pluralise) { |
| 79 | - $output = (substr($output, 0, 2) <> "1 ") ? $output . "s ago" : $output . " ago"; |
|
| 79 | + $output = (substr($output, 0, 2) <> "1 ") ? $output."s ago" : $output." ago"; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | return $output; |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | $targetScriptName = $currentScriptName; |
| 220 | 220 | } |
| 221 | 221 | else { |
| 222 | - $targetScriptName = $this->getSiteConfiguration()->getBaseUrl() . '/' . $script; |
|
| 222 | + $targetScriptName = $this->getSiteConfiguration()->getBaseUrl().'/'.$script; |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | $pathInfo = array($targetScriptName); |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $url = implode('/', $pathInfo); |
| 234 | 234 | |
| 235 | 235 | if (is_array($parameters) && count($parameters) > 0) { |
| 236 | - $url .= '?' . http_build_query($parameters); |
|
| 236 | + $url .= '?'.http_build_query($parameters); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | $this->redirectUrl($url); |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | * @param string $path The path (relative to the application root) of the file |
| 279 | 279 | */ |
| 280 | 280 | final protected function addCss($path) { |
| 281 | - if(in_array($path, $this->extraCss)){ |
|
| 281 | + if (in_array($path, $this->extraCss)) { |
|
| 282 | 282 | // nothing to do |
| 283 | 283 | return; |
| 284 | 284 | } |
@@ -291,8 +291,8 @@ discard block |
||
| 291 | 291 | * |
| 292 | 292 | * @param string $path The path (relative to the application root) of the file |
| 293 | 293 | */ |
| 294 | - final protected function addJs($path){ |
|
| 295 | - if(in_array($path, $this->extraJs)){ |
|
| 294 | + final protected function addJs($path) { |
|
| 295 | + if (in_array($path, $this->extraJs)) { |
|
| 296 | 296 | // nothing to do |
| 297 | 297 | return; |
| 298 | 298 | } |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | protected function sendResponseHeaders() |
| 346 | 346 | { |
| 347 | 347 | if (headers_sent()) { |
| 348 | - throw new ApplicationLogicException ('Headers have already been sent! This is likely a bug in the application.'); |
|
| 348 | + throw new ApplicationLogicException('Headers have already been sent! This is likely a bug in the application.'); |
|
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | foreach ($this->headerQueue as $item) { |
@@ -207,7 +207,7 @@ |
||
| 207 | 207 | } |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - public function getRoleConfiguration(){ |
|
| 210 | + public function getRoleConfiguration() { |
|
| 211 | 211 | return $this->roleConfiguration; |
| 212 | 212 | } |
| 213 | 213 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | $this->assign('currentUser', $currentUser); |
| 58 | 58 | $this->assign("loggedIn", (!$currentUser->isCommunityUser())); |
| 59 | 59 | |
| 60 | - if($this->securityManager !== null) { |
|
| 60 | + if ($this->securityManager !== null) { |
|
| 61 | 61 | $this->setupNavMenuAccess($currentUser); |
| 62 | 62 | } |
| 63 | 63 | |
@@ -29,11 +29,11 @@ discard block |
||
| 29 | 29 | foreach ($users as $user) { |
| 30 | 30 | $toAdd = array('user'); |
| 31 | 31 | |
| 32 | - if($user['status'] === 'Admin'){ |
|
| 32 | + if ($user['status'] === 'Admin') { |
|
| 33 | 33 | $toAdd[] = 'admin'; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if($user['checkuser'] == 1){ |
|
| 36 | + if ($user['checkuser'] == 1) { |
|
| 37 | 37 | $toAdd[] = 'checkuser'; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $log->setComment($logData); |
| 61 | 61 | $log->save(); |
| 62 | 62 | |
| 63 | - if($user['status'] === 'Admin' || $user['status'] === 'User'){ |
|
| 63 | + if ($user['status'] === 'Admin' || $user['status'] === 'User') { |
|
| 64 | 64 | $update->execute(array('id' => $user['id'])); |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $blacklist = array("DCC", "CCTP", "PRIVMSG"); |
| 90 | 90 | $message = str_replace($blacklist, "(IRC Blacklist)", $message); // Lets stop DCC etc |
| 91 | 91 | |
| 92 | - $msg = IrcColourCode::RESET . IrcColourCode::BOLD . "[$instanceName]" . IrcColourCode::RESET . ": $message"; |
|
| 92 | + $msg = IrcColourCode::RESET.IrcColourCode::BOLD."[$instanceName]".IrcColourCode::RESET.": $message"; |
|
| 93 | 93 | |
| 94 | 94 | try { |
| 95 | 95 | $notification = new Notification(); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function userApproved(User $user) |
| 129 | 129 | { |
| 130 | - $this->send("{$user->getUsername()} approved by " . $this->currentUser->getUsername()); |
|
| 130 | + $this->send("{$user->getUsername()} approved by ".$this->currentUser->getUsername()); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /** |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | public function userPromoted(User $user) |
| 139 | 139 | { |
| 140 | - $this->send("{$user->getUsername()} promoted to tool admin by " . $this->currentUser->getUsername()); |
|
| 140 | + $this->send("{$user->getUsername()} promoted to tool admin by ".$this->currentUser->getUsername()); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | /** |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | public function userDeclined(User $user, $reason) |
| 150 | 150 | { |
| 151 | - $this->send("{$user->getUsername()} declined by " . $this->currentUser->getUsername() . " ($reason)"); |
|
| 151 | + $this->send("{$user->getUsername()} declined by ".$this->currentUser->getUsername()." ($reason)"); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | public function userDemoted(User $user, $reason) |
| 161 | 161 | { |
| 162 | - $this->send("{$user->getUsername()} demoted by " . $this->currentUser->getUsername() . " ($reason)"); |
|
| 162 | + $this->send("{$user->getUsername()} demoted by ".$this->currentUser->getUsername()." ($reason)"); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | public function userSuspended(User $user, $reason) |
| 172 | 172 | { |
| 173 | - $this->send("{$user->getUsername()} suspended by " . $this->currentUser->getUsername() . " ($reason)"); |
|
| 173 | + $this->send("{$user->getUsername()} suspended by ".$this->currentUser->getUsername()." ($reason)"); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /** |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | public function userPrefChange(User $user) |
| 182 | 182 | { |
| 183 | - $this->send("{$user->getUsername()}'s preferences were changed by " . $this->currentUser->getUsername()); |
|
| 183 | + $this->send("{$user->getUsername()}'s preferences were changed by ".$this->currentUser->getUsername()); |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | /** |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | public function userRenamed(User $user, $old) |
| 193 | 193 | { |
| 194 | - $this->send($this->currentUser->getUsername() . " renamed $old to {$user->getUsername()}"); |
|
| 194 | + $this->send($this->currentUser->getUsername()." renamed $old to {$user->getUsername()}"); |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | /** |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | public function userRolesEdited(User $user, $reason) |
| 202 | 202 | { |
| 203 | 203 | $currentUser = $this->currentUser->getUsername(); |
| 204 | - $this->send("Active roles for {$user->getUsername()} changed by " . $currentUser . " ($reason)"); |
|
| 204 | + $this->send("Active roles for {$user->getUsername()} changed by ".$currentUser." ($reason)"); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | #endregion |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | */ |
| 214 | 214 | public function siteNoticeEdited() |
| 215 | 215 | { |
| 216 | - $this->send("Site notice edited by " . $this->currentUser->getUsername()); |
|
| 216 | + $this->send("Site notice edited by ".$this->currentUser->getUsername()); |
|
| 217 | 217 | } |
| 218 | 218 | #endregion |
| 219 | 219 | |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | */ |
| 226 | 226 | public function welcomeTemplateCreated(WelcomeTemplate $template) |
| 227 | 227 | { |
| 228 | - $this->send("Welcome template {$template->getId()} created by " . $this->currentUser->getUsername()); |
|
| 228 | + $this->send("Welcome template {$template->getId()} created by ".$this->currentUser->getUsername()); |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /** |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | */ |
| 236 | 236 | public function welcomeTemplateDeleted($templateid) |
| 237 | 237 | { |
| 238 | - $this->send("Welcome template {$templateid} deleted by " . $this->currentUser->getUsername()); |
|
| 238 | + $this->send("Welcome template {$templateid} deleted by ".$this->currentUser->getUsername()); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | /** |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | */ |
| 246 | 246 | public function welcomeTemplateEdited(WelcomeTemplate $template) |
| 247 | 247 | { |
| 248 | - $this->send("Welcome template {$template->getId()} edited by " . $this->currentUser->getUsername()); |
|
| 248 | + $this->send("Welcome template {$template->getId()} edited by ".$this->currentUser->getUsername()); |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | #endregion |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | $duration = "indefinitely"; |
| 263 | 263 | } |
| 264 | 264 | else { |
| 265 | - $duration = "until " . date("F j, Y, g:i a", $ban->getDuration()); |
|
| 265 | + $duration = "until ".date("F j, Y, g:i a", $ban->getDuration()); |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | $username = $this->currentUser->getUsername(); |
@@ -278,8 +278,8 @@ discard block |
||
| 278 | 278 | */ |
| 279 | 279 | public function unbanned(Ban $ban, $unbanreason) |
| 280 | 280 | { |
| 281 | - $this->send($ban->getTarget() . " unbanned by " . $this->currentUser |
|
| 282 | - ->getUsername() . " (" . $unbanreason . ")"); |
|
| 281 | + $this->send($ban->getTarget()." unbanned by ".$this->currentUser |
|
| 282 | + ->getUsername()." (".$unbanreason.")"); |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | #endregion |
@@ -294,15 +294,15 @@ discard block |
||
| 294 | 294 | public function requestReceived(Request $request) |
| 295 | 295 | { |
| 296 | 296 | $this->send( |
| 297 | - IrcColourCode::DARK_GREY . "[[" |
|
| 298 | - . IrcColourCode::DARK_GREEN . "acc:" |
|
| 299 | - . IrcColourCode::ORANGE . $request->getId() |
|
| 300 | - . IrcColourCode::DARK_GREY . "]]" |
|
| 301 | - . IrcColourCode::RED . " N " |
|
| 302 | - . IrcColourCode::DARK_BLUE . $this->baseUrl . "/internal.php/viewRequest?id={$request->getId()} " |
|
| 303 | - . IrcColourCode::DARK_RED . "* " |
|
| 304 | - . IrcColourCode::DARK_GREEN . $request->getName() |
|
| 305 | - . IrcColourCode::DARK_RED . " * " |
|
| 297 | + IrcColourCode::DARK_GREY."[[" |
|
| 298 | + . IrcColourCode::DARK_GREEN."acc:" |
|
| 299 | + . IrcColourCode::ORANGE.$request->getId() |
|
| 300 | + . IrcColourCode::DARK_GREY."]]" |
|
| 301 | + . IrcColourCode::RED." N " |
|
| 302 | + . IrcColourCode::DARK_BLUE.$this->baseUrl."/internal.php/viewRequest?id={$request->getId()} " |
|
| 303 | + . IrcColourCode::DARK_RED."* " |
|
| 304 | + . IrcColourCode::DARK_GREEN.$request->getName() |
|
| 305 | + . IrcColourCode::DARK_RED." * " |
|
| 306 | 306 | . IrcColourCode::RESET |
| 307 | 307 | ); |
| 308 | 308 | } |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | public function emailCreated(EmailTemplate $template) |
| 464 | 464 | { |
| 465 | 465 | $username = $this->currentUser->getUsername(); |
| 466 | - $this->send("Email {$template->getId()} ({$template->getName()}) created by " . $username); |
|
| 466 | + $this->send("Email {$template->getId()} ({$template->getName()}) created by ".$username); |
|
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | /** |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | public function emailEdited(EmailTemplate $template) |
| 475 | 475 | { |
| 476 | 476 | $username = $this->currentUser->getUsername(); |
| 477 | - $this->send("Email {$template->getId()} ({$template->getName()}) edited by " . $username); |
|
| 477 | + $this->send("Email {$template->getId()} ({$template->getName()}) edited by ".$username); |
|
| 478 | 478 | } |
| 479 | 479 | #endregion |
| 480 | 480 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | private function getNameSearchResults($searchTerm) |
| 93 | 93 | { |
| 94 | - $padded = '%' . $searchTerm . '%'; |
|
| 94 | + $padded = '%'.$searchTerm.'%'; |
|
| 95 | 95 | |
| 96 | 96 | /** @var Request[] $requests */ |
| 97 | 97 | $requests = RequestSearchHelper::get($this->getDatabase()) |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | throw new ApplicationLogicException('The search term "@" is not valid for email address searches!'); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - $padded = '%' . $searchTerm . '%'; |
|
| 119 | + $padded = '%'.$searchTerm.'%'; |
|
| 120 | 120 | |
| 121 | 121 | /** @var Request[] $requests */ |
| 122 | 122 | $requests = RequestSearchHelper::get($this->getDatabase()) |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $onWikiName = $strings->ucfirst($onWikiName); |
| 182 | 182 | |
| 183 | 183 | $parameters = self::$apiQueryParameters; |
| 184 | - $parameters['pltitles'] = "User:" . $onWikiName; |
|
| 184 | + $parameters['pltitles'] = "User:".$onWikiName; |
|
| 185 | 185 | |
| 186 | 186 | try { |
| 187 | 187 | $endpoint = $this->siteConfiguration->getMetaWikimediaWebServiceEndpoint(); |
@@ -197,6 +197,6 @@ discard block |
||
| 197 | 197 | |
| 198 | 198 | $page = @array_pop($response['query']['pages']); |
| 199 | 199 | |
| 200 | - return @$page['links'][0]['title'] === "User:" . $onWikiName; |
|
| 200 | + return @$page['links'][0]['title'] === "User:".$onWikiName; |
|
| 201 | 201 | } |
| 202 | 202 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | $this->assign('currentUser', $currentUser); |
| 58 | 58 | $this->assign("loggedIn", (!$currentUser->isCommunityUser())); |
| 59 | 59 | |
| 60 | - if($this->securityManager !== null) { |
|
| 60 | + if ($this->securityManager !== null) { |
|
| 61 | 61 | $this->setupNavMenuAccess($currentUser); |
| 62 | 62 | } |
| 63 | 63 | |