@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $now = new DateTime(); |
| 108 | 108 | $date = new DateTime($value); |
| 109 | 109 | $diff = $date->diff($now); |
| 110 | - $formula = 365 * (int)$diff->format('%y') + 30 * (int)$diff->format('%m') + (int)$diff->format('%d'); |
|
| 110 | + $formula = 365 * (int)$diff->format('%y')+30 * (int)$diff->format('%m')+(int)$diff->format('%d'); |
|
| 111 | 111 | if ($formula < 365) { |
| 112 | 112 | $this->multipliers["account-age-mult"] = 0; |
| 113 | 113 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - $multiplierKey = $row['source'] . '-mult'; |
|
| 118 | + $multiplierKey = $row['source'].'-mult'; |
|
| 119 | 119 | $multiplier = isset($this->multipliers[$multiplierKey]) ? $this->multipliers[$multiplierKey] : 1; |
| 120 | 120 | $score = max(min($value * $multiplier, 100), -100); |
| 121 | 121 | $this->scores[$key]['mult'] = $multiplier; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | ) { |
| 60 | 60 | $this->project = $project; |
| 61 | 61 | $this->user = $user; |
| 62 | - $this->categories = array_map(function ($category) { |
|
| 62 | + $this->categories = array_map(function($category) { |
|
| 63 | 63 | return str_replace(' ', '_', $category); |
| 64 | 64 | }, $categories); |
| 65 | 65 | $this->start = false === $start ? '' : date('Y-m-d', $start); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function getCategoriesNormalized() |
| 93 | 93 | { |
| 94 | - return array_map(function ($category) { |
|
| 94 | + return array_map(function($category) { |
|
| 95 | 95 | return str_replace('_', ' ', $category); |
| 96 | 96 | }, $this->categories); |
| 97 | 97 | } |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | private function getEditsFromRevs(array $revs) |
| 211 | 211 | { |
| 212 | - return array_map(function ($rev) { |
|
| 212 | + return array_map(function($rev) { |
|
| 213 | 213 | /* @var Page Page object to be passed to the Edit contructor. */ |
| 214 | 214 | $page = $this->getPageFromRev($rev); |
| 215 | 215 | $rev['user'] = $this->user; |
@@ -157,7 +157,7 @@ |
||
| 157 | 157 | // Send all to the template. |
| 158 | 158 | return $this->render('topedits/result_article.html.twig', [ |
| 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, |
@@ -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); |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | 'total_editcount' => $this->autoEdits->getEditCount(), |
| 239 | 239 | 'automated_editcount' => $this->autoEdits->getAutomatedCount(), |
| 240 | 240 | ]; |
| 241 | - $ret['nonautomated_editcount'] = $ret['total_editcount'] - $ret['automated_editcount']; |
|
| 241 | + $ret['nonautomated_editcount'] = $ret['total_editcount']-$ret['automated_editcount']; |
|
| 242 | 242 | |
| 243 | 243 | if ($tools != '') { |
| 244 | 244 | $tools = $this->autoEdits->getToolCounts(); |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | |
| 271 | 271 | $this->setupAutoEdits(); |
| 272 | 272 | |
| 273 | - $ret = array_map(function ($rev) { |
|
| 273 | + $ret = array_map(function($rev) { |
|
| 274 | 274 | return array_merge([ |
| 275 | 275 | 'full_page_title' => $this->getPageFromNsAndTitle($rev['page_namespace'], $rev['page_title'], true), |
| 276 | 276 | ], $rev); |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | $ret['tool'] = $this->autoEdits->getTool(); |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - $ret['automated_edits'] = array_map(function ($rev) { |
|
| 310 | + $ret['automated_edits'] = array_map(function($rev) { |
|
| 311 | 311 | return array_merge([ |
| 312 | 312 | 'full_page_title' => $this->getPageFromNsAndTitle($rev['page_namespace'], $rev['page_title'], true), |
| 313 | 313 | ], $rev); |
@@ -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); |
@@ -112,12 +112,12 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | // Construct the page name |
| 114 | 114 | if (!isset($this->getParameter('rfx')[$domain]['pages'][$type])) { |
| 115 | - $pageTitle= ''; |
|
| 115 | + $pageTitle = ''; |
|
| 116 | 116 | } else { |
| 117 | - $pageTitle= $this->getParameter('rfx')[$domain]['pages'][$type]; |
|
| 117 | + $pageTitle = $this->getParameter('rfx')[$domain]['pages'][$type]; |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - $pageTitle.= '/'.$this->user->getUsername(); |
|
| 120 | + $pageTitle .= '/'.$this->user->getUsername(); |
|
| 121 | 121 | $page = new Page($this->project, $pageTitle); |
| 122 | 122 | $pageRepo = new PageRepository(); |
| 123 | 123 | $pageRepo->setContainer($this->container); |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | $neutral = $rfx->getSection('neutral'); |
| 146 | 146 | $dup = $rfx->getDuplicates(); |
| 147 | 147 | |
| 148 | - $total = count($support) + count($oppose) + count($neutral); |
|
| 148 | + $total = count($support)+count($oppose)+count($neutral); |
|
| 149 | 149 | |
| 150 | 150 | if ($total === 0) { |
| 151 | 151 | $this->addFlash('notice', ['no-result', $pageTitle]); |
@@ -151,7 +151,7 @@ |
||
| 151 | 151 | $this->setUpAdminStats(); |
| 152 | 152 | |
| 153 | 153 | // Maximum 30 days. |
| 154 | - $days = min((int) $days, 30); |
|
| 154 | + $days = min((int)$days, 30); |
|
| 155 | 155 | $start = date('Y-m-d', strtotime("-$days days")); |
| 156 | 156 | $end = date('Y-m-d'); |
| 157 | 157 | |