@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $cacheResult->delete(); |
73 | 73 | |
74 | 74 | if (isset($result['error']['info'])) { |
75 | - throw new Exception("Unrecognised API response to query: " . $result['error']['info']); |
|
75 | + throw new Exception("Unrecognised API response to query: ".$result['error']['info']); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | throw new Exception("Unrecognised API response to query."); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | if ($result['antispoof']['result'] == "error") { |
92 | 92 | // we've got conflicts, let's do something with them. |
93 | - throw new Exception("Encountered error while getting result: " . $result['antispoof']['error']); |
|
93 | + throw new Exception("Encountered error while getting result: ".$result['antispoof']['error']); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | throw new Exception("Unrecognised API response to query."); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $statement = $database->prepare($query); |
63 | 63 | |
64 | 64 | foreach ($destinationIps as $ip) { |
65 | - echo 'Fetching data for ' . $ip . PHP_EOL; |
|
65 | + echo 'Fetching data for '.$ip.PHP_EOL; |
|
66 | 66 | |
67 | 67 | $statement->bindValue(':exitaddr', $ip); |
68 | 68 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | )); |
82 | 82 | |
83 | 83 | foreach (array(80 => $http, 443 => $https) as $port => $response) { |
84 | - echo ' Running for port ' . $ip . ':' . $port . PHP_EOL; |
|
84 | + echo ' Running for port '.$ip.':'.$port.PHP_EOL; |
|
85 | 85 | |
86 | 86 | $statement->bindValue(':exitport', $port); |
87 | 87 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
102 | - echo 'Done for ' . $ip . PHP_EOL; |
|
102 | + echo 'Done for '.$ip.PHP_EOL; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | // kill old cached entries |
@@ -41,8 +41,8 @@ |
||
41 | 41 | $data = htmlentities($data, ENT_COMPAT, 'UTF-8'); |
42 | 42 | } |
43 | 43 | |
44 | - echo '<script>window.location.href="' . str_replace("%DATA%", $data, $toolList[$tool]) . '"</script>'; |
|
44 | + echo '<script>window.location.href="'.str_replace("%DATA%", $data, $toolList[$tool]).'"</script>'; |
|
45 | 45 | } |
46 | 46 | else { |
47 | - header("Location: " . $_SERVER["REQUEST_URI"] . "&round2=true"); |
|
47 | + header("Location: ".$_SERVER["REQUEST_URI"]."&round2=true"); |
|
48 | 48 | } |
@@ -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; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @param string $column The required column |
78 | 78 | * @return array |
79 | 79 | */ |
80 | - public function fetchColumn($column){ |
|
80 | + public function fetchColumn($column) { |
|
81 | 81 | $statement = $this->getData($column); |
82 | 82 | |
83 | 83 | return $statement->fetchAll(PDO::FETCH_COLUMN); |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function getRecordCount(&$count) |
92 | 92 | { |
93 | - $query = 'SELECT /* SearchHelper */ COUNT(*) FROM ' . $this->table . ' origin '; |
|
94 | - $query .= $this->joinClause . $this->whereClause; |
|
93 | + $query = 'SELECT /* SearchHelper */ COUNT(*) FROM '.$this->table.' origin '; |
|
94 | + $query .= $this->joinClause.$this->whereClause; |
|
95 | 95 | |
96 | 96 | $statement = $this->database->prepare($query); |
97 | 97 | $statement->execute($this->parameterList); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | private function applyOrder() |
139 | 139 | { |
140 | 140 | if ($this->orderBy !== null) { |
141 | - return ' ORDER BY ' . $this->orderBy; |
|
141 | + return ' ORDER BY '.$this->orderBy; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | return ''; |
@@ -168,8 +168,8 @@ discard block |
||
168 | 168 | */ |
169 | 169 | protected function buildQuery($column) |
170 | 170 | { |
171 | - $query = 'SELECT /* SearchHelper */ origin.' . $column . ' FROM ' . $this->table . ' origin '; |
|
172 | - $query .= $this->joinClause . $this->whereClause; |
|
171 | + $query = 'SELECT /* SearchHelper */ origin.'.$column.' FROM '.$this->table.' origin '; |
|
172 | + $query .= $this->joinClause.$this->whereClause; |
|
173 | 173 | |
174 | 174 | return $query; |
175 | 175 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $valueCount = count($values); |
189 | 189 | |
190 | 190 | // Firstly, let's create a string of question marks, which will do as positional parameters. |
191 | - $inSection = str_repeat('?,', $valueCount - 1) . '?'; |
|
191 | + $inSection = str_repeat('?,', $valueCount - 1).'?'; |
|
192 | 192 | |
193 | 193 | $this->whereClause .= " AND {$column} IN ({$inSection})"; |
194 | 194 | $this->parameterList = array_merge($this->parameterList, $values); |
@@ -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) { |
@@ -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 | } |