@@ -12,7 +12,7 @@ |
||
| 12 | 12 | // Feel free to remove this, extend it, or make something more sophisticated. |
| 13 | 13 | if (isset($_SERVER['HTTP_CLIENT_IP']) |
| 14 | 14 | || isset($_SERVER['HTTP_X_FORWARDED_FOR']) |
| 15 | - || !( in_array(@$_SERVER['REMOTE_ADDR'], [ '127.0.0.1', 'fe80::1', '::1' ]) || php_sapi_name() === 'cli-server' ) |
|
| 15 | + || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || php_sapi_name() === 'cli-server') |
|
| 16 | 16 | ) { |
| 17 | 17 | header('HTTP/1.0 403 Forbidden'); |
| 18 | 18 | exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | 'quote/all.html.twig', |
| 112 | 112 | [ |
| 113 | 113 | 'base_dir' => realpath( |
| 114 | - $this->getParameter('kernel.root_dir') . '/..' |
|
| 114 | + $this->getParameter('kernel.root_dir').'/..' |
|
| 115 | 115 | ), |
| 116 | 116 | 'xtPage' => 'bash', |
| 117 | 117 | 'quotes' => $quotes, |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | 'quote/view.html.twig', |
| 161 | 161 | [ |
| 162 | 162 | 'base_dir' => realpath( |
| 163 | - $this->getParameter('kernel.root_dir') . '/..' |
|
| 163 | + $this->getParameter('kernel.root_dir').'/..' |
|
| 164 | 164 | ), |
| 165 | 165 | "xtPage" => "bash", |
| 166 | 166 | "text" => $text, |
@@ -146,10 +146,10 @@ discard block |
||
| 146 | 146 | $resultQuery->execute(); |
| 147 | 147 | $results = $resultQuery->fetchAll(); |
| 148 | 148 | $logCounts = array_combine( |
| 149 | - array_map(function ($e) { |
|
| 149 | + array_map(function($e) { |
|
| 150 | 150 | return $e['source']; |
| 151 | 151 | }, $results), |
| 152 | - array_map(function ($e) { |
|
| 152 | + array_map(function($e) { |
|
| 153 | 153 | return $e['value']; |
| 154 | 154 | }, $results) |
| 155 | 155 | ); |
@@ -366,9 +366,9 @@ discard block |
||
| 366 | 366 | $resultQuery->bindParam(":id", $userId); |
| 367 | 367 | $resultQuery->execute(); |
| 368 | 368 | $results = $resultQuery->fetchAll(); |
| 369 | - $namespaceTotals = array_combine(array_map(function ($e) { |
|
| 369 | + $namespaceTotals = array_combine(array_map(function($e) { |
|
| 370 | 370 | return $e['page_namespace']; |
| 371 | - }, $results), array_map(function ($e) { |
|
| 371 | + }, $results), array_map(function($e) { |
|
| 372 | 372 | return $e['total']; |
| 373 | 373 | }, $results)); |
| 374 | 374 | |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | } |
| 428 | 428 | $queries[] = $sql; |
| 429 | 429 | } |
| 430 | - $sql = "(\n" . join("\n) UNION (\n", $queries) . ")\n"; |
|
| 430 | + $sql = "(\n".join("\n) UNION (\n", $queries).")\n"; |
|
| 431 | 431 | $resultQuery = $this->getProjectsConnection()->prepare($sql); |
| 432 | 432 | $resultQuery->bindParam(":username", $username); |
| 433 | 433 | $resultQuery->execute(); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - $final = []; // initialize the final array |
|
| 122 | + $final = []; // initialize the final array |
|
| 123 | 123 | $finalRaw = []; // Initialize the raw data array |
| 124 | 124 | |
| 125 | 125 | foreach ($this->data as $key => $value) { |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | $final = array_count_values($final); // find repetition and its count |
| 134 | 134 | |
| 135 | - $final = array_diff($final, [1]); // remove single occurrences |
|
| 135 | + $final = array_diff($final, [1]); // remove single occurrences |
|
| 136 | 136 | |
| 137 | 137 | $this->duplicates = array_keys($final); |
| 138 | 138 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $username = $request->query->get('username'); |
| 49 | 49 | |
| 50 | 50 | if ($projectQuery != '' && $username != '') { |
| 51 | - $routeParams = [ 'project' => $projectQuery, 'username' => $username ]; |
|
| 51 | + $routeParams = ['project' => $projectQuery, 'username' => $username]; |
|
| 52 | 52 | return $this->redirectToRoute( |
| 53 | 53 | 'rfxvoteResult', |
| 54 | 54 | $routeParams |
@@ -167,8 +167,8 @@ discard block |
||
| 167 | 167 | $titles = []; |
| 168 | 168 | |
| 169 | 169 | while ($row = $sth->fetch()) { |
| 170 | - $titles[] = $namespaces[$row['page_namespace']] . |
|
| 171 | - ':' .$row['page_title']; |
|
| 170 | + $titles[] = $namespaces[$row['page_namespace']]. |
|
| 171 | + ':'.$row['page_title']; |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | // Chunking... it's possible to make a URI too long |
@@ -166,7 +166,7 @@ |
||
| 166 | 166 | $neutral = $rfx->getSection('neutral'); |
| 167 | 167 | $dup = $rfx->getDuplicates(); |
| 168 | 168 | |
| 169 | - $total = count($support) + count($oppose) + count($neutral); |
|
| 169 | + $total = count($support)+count($oppose)+count($neutral); |
|
| 170 | 170 | |
| 171 | 171 | if ($total === 0) { |
| 172 | 172 | $this->addFlash('notice', ['no-result', $pagename]); |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | // Find the path, and complain if English doesn't exist. |
| 60 | - $path = $this->container->getParameter('kernel.root_dir') . '/../i18n'; |
|
| 60 | + $path = $this->container->getParameter('kernel.root_dir').'/../i18n'; |
|
| 61 | 61 | if (!file_exists("$path/en.json")) { |
| 62 | 62 | throw new Exception("Language directory doesn't exist: $path"); |
| 63 | 63 | } |
@@ -191,7 +191,7 @@ |
||
| 191 | 191 | // Send all to the template. |
| 192 | 192 | return $this->render('topedits/result_article.html.twig', [ |
| 193 | 193 | 'xtPage' => 'topedits', |
| 194 | - 'xtTitle' => $user->getUsername() . ' - ' . $page->getTitle(), |
|
| 194 | + 'xtTitle' => $user->getUsername().' - '.$page->getTitle(), |
|
| 195 | 195 | 'project' => $project, |
| 196 | 196 | 'user' => $user, |
| 197 | 197 | 'page' => $page, |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | $userGroupsTable = $project->getTableName('user_groups'); |
| 53 | 53 | $ufgTable = $project->getTableName('user_former_groups'); |
| 54 | 54 | |
| 55 | - $adminGroups = join(array_map(function ($group) { |
|
| 55 | + $adminGroups = join(array_map(function($group) { |
|
| 56 | 56 | return "'$group'"; |
| 57 | 57 | }, $this->getAdminGroups($project)), ','); |
| 58 | 58 | |