@@ -272,7 +272,7 @@ |
||
272 | 272 | 'total_editcount' => $this->autoEdits->getEditCount(), |
273 | 273 | 'automated_editcount' => $this->autoEdits->getAutomatedCount(), |
274 | 274 | ]; |
275 | - $ret['nonautomated_editcount'] = $ret['total_editcount'] - $ret['automated_editcount']; |
|
275 | + $ret['nonautomated_editcount'] = $ret['total_editcount']-$ret['automated_editcount']; |
|
276 | 276 | |
277 | 277 | if (isset($this->params['tools'])) { |
278 | 278 | $tools = $this->autoEdits->getToolCounts(); |
@@ -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 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | 4 | namespace App\Controller; |
5 | 5 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $pages = []; |
129 | 129 | foreach ($lp->getResults() as $index => $page) { |
130 | 130 | $pages[] = [ |
131 | - 'rank' => $index + 1, |
|
131 | + 'rank' => $index+1, |
|
132 | 132 | 'page_title' => $page->getTitle(true), |
133 | 133 | 'length' => $page->getLength(), |
134 | 134 | ]; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | public function loginAction(Request $request, SessionInterface $session): RedirectResponse |
95 | 95 | { |
96 | 96 | try { |
97 | - [ $next, $token ] = $this->getOauthClient($request)->initiate(); |
|
97 | + [$next, $token] = $this->getOauthClient($request)->initiate(); |
|
98 | 98 | } catch (Exception $oauthException) { |
99 | 99 | throw $oauthException; |
100 | 100 | // @TODO Make this work. |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | . '?title=Special:OAuth'; |
176 | 176 | $conf = new ClientConfig($endpoint); |
177 | 177 | $consumerKey = $this->getParameter('oauth_key'); |
178 | - $consumerSecret = $this->getParameter('oauth_secret'); |
|
178 | + $consumerSecret = $this->getParameter('oauth_secret'); |
|
179 | 179 | $conf->setConsumer(new Consumer($consumerKey, $consumerSecret)); |
180 | 180 | $this->oauthClient = new Client($conf); |
181 | 181 |
@@ -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); |
@@ -128,7 +128,7 @@ |
||
128 | 128 | // 'Category:', which sometimes is used cross-wiki (because it still works). |
129 | 129 | $normalized = false; |
130 | 130 | $nsName = $this->project->getNamespaces()[14].':'; |
131 | - $this->categories = array_map(function ($category) use ($nsName, &$normalized) { |
|
131 | + $this->categories = array_map(function($category) use ($nsName, &$normalized) { |
|
132 | 132 | if (0 === strpos($category, $nsName) || 0 === strpos($category, 'Category:')) { |
133 | 133 | $normalized = true; |
134 | 134 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $timeline = []; |
102 | 102 | $startObj = new DateTime($start); |
103 | 103 | $endObj = new DateTime($end); |
104 | - $numDays = (int) $endObj->diff($startObj)->format("%a"); |
|
104 | + $numDays = (int)$endObj->diff($startObj)->format("%a"); |
|
105 | 105 | $grandSum = 0; |
106 | 106 | |
107 | 107 | // Generate array of date labels |
@@ -111,17 +111,17 @@ discard block |
||
111 | 111 | |
112 | 112 | foreach ($data as $entry) { |
113 | 113 | if (!isset($totals[$entry['tool']])) { |
114 | - $totals[$entry['tool']] = (int) $entry['count']; |
|
114 | + $totals[$entry['tool']] = (int)$entry['count']; |
|
115 | 115 | |
116 | 116 | // Create arrays for each tool, filled with zeros for each date in the timeline |
117 | 117 | $timeline[$entry['tool']] = array_fill(0, $numDays, 0); |
118 | 118 | } else { |
119 | - $totals[$entry['tool']] += (int) $entry['count']; |
|
119 | + $totals[$entry['tool']] += (int)$entry['count']; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | $date = new DateTime($entry['date']); |
123 | - $dateIndex = (int) $date->diff($startObj)->format("%a"); |
|
124 | - $timeline[$entry['tool']][$dateIndex] = (int) $entry['count']; |
|
123 | + $dateIndex = (int)$date->diff($startObj)->format("%a"); |
|
124 | + $timeline[$entry['tool']][$dateIndex] = (int)$entry['count']; |
|
125 | 125 | |
126 | 126 | $grandSum += $entry['count']; |
127 | 127 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $timeline = []; |
160 | 160 | $startObj = new DateTime($start); |
161 | 161 | $endObj = new DateTime($end); |
162 | - $numDays = (int) $endObj->diff($startObj)->format("%a"); |
|
162 | + $numDays = (int)$endObj->diff($startObj)->format("%a"); |
|
163 | 163 | $grandSum = 0; |
164 | 164 | |
165 | 165 | // Generate array of date labels |
@@ -169,17 +169,17 @@ discard block |
||
169 | 169 | |
170 | 170 | foreach ($data as $entry) { |
171 | 171 | if (!isset($totals[$entry['endpoint']])) { |
172 | - $totals[$entry['endpoint']] = (int) $entry['count']; |
|
172 | + $totals[$entry['endpoint']] = (int)$entry['count']; |
|
173 | 173 | |
174 | 174 | // Create arrays for each endpoint, filled with zeros for each date in the timeline |
175 | 175 | $timeline[$entry['endpoint']] = array_fill(0, $numDays, 0); |
176 | 176 | } else { |
177 | - $totals[$entry['endpoint']] += (int) $entry['count']; |
|
177 | + $totals[$entry['endpoint']] += (int)$entry['count']; |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | $date = new DateTime($entry['date']); |
181 | - $dateIndex = (int) $date->diff($startObj)->format("%a"); |
|
182 | - $timeline[$entry['endpoint']][$dateIndex] = (int) $entry['count']; |
|
181 | + $dateIndex = (int)$date->diff($startObj)->format("%a"); |
|
182 | + $timeline[$entry['endpoint']][$dateIndex] = (int)$entry['count']; |
|
183 | 183 | |
184 | 184 | $grandSum += $entry['count']; |
185 | 185 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | |
232 | 232 | /** @var Connection $conn */ |
233 | 233 | $conn = $this->container->get('doctrine')->getManager('default')->getConnection(); |
234 | - $date = date('Y-m-d'); |
|
234 | + $date = date('Y-m-d'); |
|
235 | 235 | |
236 | 236 | // Tool name needs to be lowercase. |
237 | 237 | $tool = strtolower($tool); |
@@ -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 (0 === $total) { |
151 | 151 | $this->addFlashMessage('notice', 'no-result', [$pageTitle]); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | 4 | namespace App\Controller; |
5 | 5 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $this->project = $defaultProject; |
192 | 192 | |
193 | 193 | $results = $globalContribs->globalEdits(); |
194 | - $results = array_map(function (Edit $edit) { |
|
194 | + $results = array_map(function(Edit $edit) { |
|
195 | 195 | return $edit->getForJson(true, true); |
196 | 196 | }, array_values($results)); |
197 | 197 | $results = $this->addFullPageTitlesAndContinue('globalcontribs', [], $results); |