@@ -372,7 +372,7 @@ |
||
| 372 | 372 | ]; |
| 373 | 373 | |
| 374 | 374 | if ($pages->getNumResults() === $pages->resultsPerPage()) { |
| 375 | - $ret['continue'] = $this->offset + 1; |
|
| 375 | + $ret['continue'] = $this->offset+1; |
|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | return $this->getFormattedApiResponse($ret, 'user/pages'); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | public function loginAction(): RedirectResponse |
| 106 | 106 | { |
| 107 | 107 | try { |
| 108 | - [ $next, $token ] = $this->getOauthClient()->initiate(); |
|
| 108 | + [$next, $token] = $this->getOauthClient()->initiate(); |
|
| 109 | 109 | } catch (Exception $oauthException) { |
| 110 | 110 | throw $oauthException; |
| 111 | 111 | // @TODO Make this work. |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | . '?title=Special:OAuth'; |
| 182 | 182 | $conf = new ClientConfig($endpoint); |
| 183 | 183 | $consumerKey = $this->getParameter('oauth_key'); |
| 184 | - $consumerSecret = $this->getParameter('oauth_secret'); |
|
| 184 | + $consumerSecret = $this->getParameter('oauth_secret'); |
|
| 185 | 185 | $conf->setConsumer(new Consumer($consumerKey, $consumerSecret)); |
| 186 | 186 | $this->oauthClient = new Client($conf); |
| 187 | 187 | // Callback URL is hardcoded in the consumer registration. |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | 'projects' => array_keys($this->container->getParameter('assessments')), |
| 263 | 263 | 'config' => $this->container->getParameter('assessments'), |
| 264 | 264 | ]); |
| 265 | - $response->setCallbackAction(function (): void { |
|
| 265 | + $response->setCallbackAction(function(): void { |
|
| 266 | 266 | // Intentionally record this as the same endpoint as ProjectApiAssessments. |
| 267 | 267 | $this->recordApiUsage('project/assessments'); |
| 268 | 268 | }); |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | // Number the quotes, since they somehow have significance. |
| 188 | 188 | foreach ($quotes as $index => $quote) { |
| 189 | - $numberedQuotes[(string)($index + 1)] = $quote; |
|
| 189 | + $numberedQuotes[(string)($index+1)] = $quote; |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | return $this->getResponse($numberedQuotes, 'quote/all'); |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | { |
| 247 | 247 | $response = new EarlyJsonResponse(); |
| 248 | 248 | $response->setData($data); |
| 249 | - $response->setCallbackAction(function () use ($endpoint): void { |
|
| 249 | + $response->setCallbackAction(function() use ($endpoint): void { |
|
| 250 | 250 | $this->recordApiUsage($endpoint); |
| 251 | 251 | }); |
| 252 | 252 | return $response; |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | 'total_editcount' => $this->autoEdits->getEditCount(), |
| 251 | 251 | 'automated_editcount' => $this->autoEdits->getAutomatedCount(), |
| 252 | 252 | ]; |
| 253 | - $ret['nonautomated_editcount'] = $ret['total_editcount'] - $ret['automated_editcount']; |
|
| 253 | + $ret['nonautomated_editcount'] = $ret['total_editcount']-$ret['automated_editcount']; |
|
| 254 | 254 | |
| 255 | 255 | if ('' != $tools) { |
| 256 | 256 | $tools = $this->autoEdits->getToolCounts(); |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | { |
| 281 | 281 | $this->setupAutoEdits(); |
| 282 | 282 | |
| 283 | - $ret = array_map(function ($rev) { |
|
| 283 | + $ret = array_map(function($rev) { |
|
| 284 | 284 | return array_merge([ |
| 285 | 285 | 'full_page_title' => $this->getPageFromNsAndTitle( |
| 286 | 286 | (int)$rev['page_namespace'], |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | $ret['tool'] = $this->autoEdits->getTool(); |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | - $ret['automated_edits'] = array_map(function ($rev) { |
|
| 322 | + $ret['automated_edits'] = array_map(function($rev) { |
|
| 323 | 323 | return array_merge([ |
| 324 | 324 | 'full_page_title' => $this->getPageFromNsAndTitle( |
| 325 | 325 | (int)$rev['page_namespace'], |
@@ -629,7 +629,7 @@ discard block |
||
| 629 | 629 | $params = $this->convertLegacyParams($params); |
| 630 | 630 | |
| 631 | 631 | // Remove blank values. |
| 632 | - return array_filter($params, function ($param) { |
|
| 632 | + return array_filter($params, function($param) { |
|
| 633 | 633 | // 'namespace' or 'username' could be '0'. |
| 634 | 634 | return null !== $param && '' !== $param; |
| 635 | 635 | }); |
@@ -822,7 +822,7 @@ discard block |
||
| 822 | 822 | // Use EarlyJsonResponse so that we run the database transactions to record usage |
| 823 | 823 | // after the response has already been returned. |
| 824 | 824 | $response = new EarlyJsonResponse(); |
| 825 | - $response->setCallbackAction(function () use ($endpoint): void { |
|
| 825 | + $response->setCallbackAction(function() use ($endpoint): void { |
|
| 826 | 826 | if (null !== $endpoint) { |
| 827 | 827 | $this->recordApiUsage($endpoint); |
| 828 | 828 | } |
@@ -831,7 +831,7 @@ discard block |
||
| 831 | 831 | $response->setStatusCode(Response::HTTP_OK); |
| 832 | 832 | |
| 833 | 833 | $elapsedTime = round( |
| 834 | - microtime(true) - $this->request->server->get('REQUEST_TIME_FLOAT'), |
|
| 834 | + microtime(true)-$this->request->server->get('REQUEST_TIME_FLOAT'), |
|
| 835 | 835 | 3 |
| 836 | 836 | ); |
| 837 | 837 | |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | $conn = $this->container->get('doctrine') |
| 876 | 876 | ->getManager('default') |
| 877 | 877 | ->getConnection(); |
| 878 | - $date = date('Y-m-d'); |
|
| 878 | + $date = date('Y-m-d'); |
|
| 879 | 879 | |
| 880 | 880 | // Increment count in timeline |
| 881 | 881 | $existsSql = "SELECT 1 FROM usage_api_timeline |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace AppBundle\Response; |
| 5 | 5 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types = 1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | use AppBundle\Response\EarlyJsonResponse; |
| 6 | 6 | use Symfony\Component\Config\Loader\LoaderInterface; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | new AppBundle\AppBundle(), |
| 47 | 47 | ]; |
| 48 | 48 | |
| 49 | - if (in_array($this->getEnvironment(), [ 'dev', 'test' ], true)) { |
|
| 49 | + if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { |
|
| 50 | 50 | $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); |
| 51 | 51 | $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); |
| 52 | 52 | } |