@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $timeline = []; |
| 96 | 96 | $startObj = new DateTime($start); |
| 97 | 97 | $endObj = new DateTime($end); |
| 98 | - $numDays = (int) $endObj->diff($startObj)->format("%a"); |
|
| 98 | + $numDays = (int)$endObj->diff($startObj)->format("%a"); |
|
| 99 | 99 | $grandSum = 0; |
| 100 | 100 | |
| 101 | 101 | // Generate array of date labels |
@@ -105,17 +105,17 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | foreach ($data as $entry) { |
| 107 | 107 | if (!isset($totals[$entry['tool']])) { |
| 108 | - $totals[$entry['tool']] = (int) $entry['count']; |
|
| 108 | + $totals[$entry['tool']] = (int)$entry['count']; |
|
| 109 | 109 | |
| 110 | 110 | // Create arrays for each tool, filled with zeros for each date in the timeline |
| 111 | 111 | $timeline[$entry['tool']] = array_fill(0, $numDays, 0); |
| 112 | 112 | } else { |
| 113 | - $totals[$entry['tool']] += (int) $entry['count']; |
|
| 113 | + $totals[$entry['tool']] += (int)$entry['count']; |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $date = new DateTime($entry['date']); |
| 117 | - $dateIndex = (int) $date->diff($startObj)->format("%a"); |
|
| 118 | - $timeline[$entry['tool']][$dateIndex] = (int) $entry['count']; |
|
| 117 | + $dateIndex = (int)$date->diff($startObj)->format("%a"); |
|
| 118 | + $timeline[$entry['tool']][$dateIndex] = (int)$entry['count']; |
|
| 119 | 119 | |
| 120 | 120 | $grandSum += $entry['count']; |
| 121 | 121 | } |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $timeline = []; |
| 153 | 153 | $startObj = new DateTime($start); |
| 154 | 154 | $endObj = new DateTime($end); |
| 155 | - $numDays = (int) $endObj->diff($startObj)->format("%a"); |
|
| 155 | + $numDays = (int)$endObj->diff($startObj)->format("%a"); |
|
| 156 | 156 | $grandSum = 0; |
| 157 | 157 | |
| 158 | 158 | // Generate array of date labels |
@@ -162,17 +162,17 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | foreach ($data as $entry) { |
| 164 | 164 | if (!isset($totals[$entry['endpoint']])) { |
| 165 | - $totals[$entry['endpoint']] = (int) $entry['count']; |
|
| 165 | + $totals[$entry['endpoint']] = (int)$entry['count']; |
|
| 166 | 166 | |
| 167 | 167 | // Create arrays for each endpoint, filled with zeros for each date in the timeline |
| 168 | 168 | $timeline[$entry['endpoint']] = array_fill(0, $numDays, 0); |
| 169 | 169 | } else { |
| 170 | - $totals[$entry['endpoint']] += (int) $entry['count']; |
|
| 170 | + $totals[$entry['endpoint']] += (int)$entry['count']; |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | $date = new DateTime($entry['date']); |
| 174 | - $dateIndex = (int) $date->diff($startObj)->format("%a"); |
|
| 175 | - $timeline[$entry['endpoint']][$dateIndex] = (int) $entry['count']; |
|
| 174 | + $dateIndex = (int)$date->diff($startObj)->format("%a"); |
|
| 175 | + $timeline[$entry['endpoint']][$dateIndex] = (int)$entry['count']; |
|
| 176 | 176 | |
| 177 | 177 | $grandSum += $entry['count']; |
| 178 | 178 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | $conn = $this->container->get('doctrine')->getManager('default')->getConnection(); |
| 222 | - $date = date('Y-m-d'); |
|
| 222 | + $date = date('Y-m-d'); |
|
| 223 | 223 | |
| 224 | 224 | // Increment count in timeline |
| 225 | 225 | $existsSql = "SELECT 1 FROM usage_timeline |
@@ -136,8 +136,8 @@ |
||
| 136 | 136 | $titles = []; |
| 137 | 137 | |
| 138 | 138 | while ($row = $sth->fetch()) { |
| 139 | - $titles[] = $namespaces[$row['page_namespace']] . |
|
| 140 | - ':' .$row['page_title']; |
|
| 139 | + $titles[] = $namespaces[$row['page_namespace']]. |
|
| 140 | + ':'.$row['page_title']; |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | // Chunking... it's possible to make a URI too long |
@@ -347,7 +347,7 @@ |
||
| 347 | 347 | ]; |
| 348 | 348 | |
| 349 | 349 | if ($pages->getNumResults() === $pages->resultsPerPage()) { |
| 350 | - $ret['continue'] = $this->offset + 1; |
|
| 350 | + $ret['continue'] = $this->offset+1; |
|
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | return $this->getFormattedApiResponse($ret); |
@@ -197,7 +197,7 @@ |
||
| 197 | 197 | |
| 198 | 198 | // Number the quotes, since they somehow have significance. |
| 199 | 199 | foreach ($quotes as $index => $quote) { |
| 200 | - $numberedQuotes[(string)($index + 1)] = $quote; |
|
| 200 | + $numberedQuotes[(string)($index+1)] = $quote; |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | return new JsonResponse($numberedQuotes, Response::HTTP_OK); |
@@ -157,7 +157,7 @@ |
||
| 157 | 157 | // Send all to the template. |
| 158 | 158 | return $this->getFormattedResponse('topedits/result_article', [ |
| 159 | 159 | 'xtPage' => 'topedits', |
| 160 | - 'xtTitle' => $this->user->getUsername() . ' - ' . $this->page->getTitle(), |
|
| 160 | + 'xtTitle' => $this->user->getUsername().' - '.$this->page->getTitle(), |
|
| 161 | 161 | 'project' => $this->project, |
| 162 | 162 | 'user' => $this->user, |
| 163 | 163 | 'page' => $this->page, |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $sections = is_array($sectionsQuery) ? $sectionsQuery : explode('|', $sectionsQuery); |
| 168 | 168 | |
| 169 | 169 | // Filter out any invalid section IDs. |
| 170 | - $sections = array_filter($sections, function ($section) { |
|
| 170 | + $sections = array_filter($sections, function($section) { |
|
| 171 | 171 | return in_array($section, $this->getSectionNames()); |
| 172 | 172 | }); |
| 173 | 173 | |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | $ret = [ |
| 240 | - 'xtTitle' => $this->user->getUsername() . ' - ' . $this->project->getTitle(), |
|
| 240 | + 'xtTitle' => $this->user->getUsername().' - '.$this->project->getTitle(), |
|
| 241 | 241 | 'xtPage' => 'editcounter', |
| 242 | 242 | 'user' => $this->user, |
| 243 | 243 | 'project' => $this->project, |
@@ -149,7 +149,7 @@ |
||
| 149 | 149 | $this->setUpAdminStats(); |
| 150 | 150 | |
| 151 | 151 | // Maximum 31 days. |
| 152 | - $days = min((int) $days, 31); |
|
| 152 | + $days = min((int)$days, 31); |
|
| 153 | 153 | $start = date('Y-m-d', strtotime("-$days days")); |
| 154 | 154 | $end = date('Y-m-d'); |
| 155 | 155 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | use Symfony\Component\HttpFoundation\Request; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | use Symfony\Component\Debug\Debug; |
| 5 | 5 | use Symfony\Component\HttpFoundation\Request; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | // Feel free to remove this, extend it, or make something more sophisticated. |
| 14 | 14 | if (isset($_SERVER['HTTP_CLIENT_IP']) |
| 15 | 15 | || isset($_SERVER['HTTP_X_FORWARDED_FOR']) |
| 16 | - || !( in_array(@$_SERVER['REMOTE_ADDR'], [ '127.0.0.1', 'fe80::1', '::1' ]) || 'cli-server' === php_sapi_name() ) |
|
| 16 | + || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || 'cli-server' === php_sapi_name()) |
|
| 17 | 17 | ) { |
| 18 | 18 | header('HTTP/1.0 403 Forbidden'); |
| 19 | 19 | exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); |