@@ -170,7 +170,7 @@ |
||
170 | 170 | /** |
171 | 171 | * Get edit count within given timeframe and namespace |
172 | 172 | * @param Project $project |
173 | - * @param int|string $namespace Namespace ID or 'all' for all namespaces |
|
173 | + * @param integer $namespace Namespace ID or 'all' for all namespaces |
|
174 | 174 | * @param string $start Start date in a format accepted by strtotime() |
175 | 175 | * @param string $end End date in a format accepted by strtotime() |
176 | 176 | */ |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $this->getUsername() |
90 | 90 | ); |
91 | 91 | |
92 | - return (int) $editCount; |
|
92 | + return (int)$editCount; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | */ |
205 | 205 | public function countAutomatedEdits(Project $project, $namespace = 'all', $start = '', $end = '') |
206 | 206 | { |
207 | - return (int) $this->getRepository()->countAutomatedEdits($project, $this, $namespace, $start, $end); |
|
207 | + return (int)$this->getRepository()->countAutomatedEdits($project, $this, $namespace, $start, $end); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
@@ -236,21 +236,21 @@ discard block |
||
236 | 236 | |
237 | 237 | $namespaces = $project->getNamespaces(); |
238 | 238 | |
239 | - return array_map(function ($rev) use ($namespaces) { |
|
239 | + return array_map(function($rev) use ($namespaces) { |
|
240 | 240 | $pageTitle = $rev['page_title']; |
241 | 241 | |
242 | 242 | if ($rev['page_namespace'] !== '0') { |
243 | - $pageTitle = $namespaces[$rev['page_namespace']] . ":$pageTitle"; |
|
243 | + $pageTitle = $namespaces[$rev['page_namespace']].":$pageTitle"; |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | return [ |
247 | 247 | 'page_title' => $pageTitle, |
248 | - 'page_namespace' => (int) $rev['page_namespace'], |
|
249 | - 'rev_id' => (int) $rev['rev_id'], |
|
248 | + 'page_namespace' => (int)$rev['page_namespace'], |
|
249 | + 'rev_id' => (int)$rev['rev_id'], |
|
250 | 250 | 'timestamp' => DateTime::createFromFormat('YmdHis', $rev['timestamp']), |
251 | - 'minor' => (bool) $rev['minor'], |
|
252 | - 'length' => (int) $rev['length'], |
|
253 | - 'length_change' => (int) $rev['length_change'], |
|
251 | + 'minor' => (bool)$rev['minor'], |
|
252 | + 'length' => (int)$rev['length'], |
|
253 | + 'length_change' => (int)$rev['length_change'], |
|
254 | 254 | 'comment' => $rev['comment'], |
255 | 255 | ]; |
256 | 256 | }, $revs); |
@@ -32,33 +32,33 @@ discard block |
||
32 | 32 | { |
33 | 33 | $options = ['is_safe' => ['html']]; |
34 | 34 | return [ |
35 | - new \Twig_SimpleFunction('request_time', [ $this, 'requestTime' ], $options), |
|
36 | - new \Twig_SimpleFunction('memory_usage', [ $this, 'requestMemory' ], $options), |
|
37 | - new \Twig_SimpleFunction('year', [ $this, 'generateYear' ], $options), |
|
38 | - new \Twig_SimpleFunction('msgPrintExists', [ $this, 'intuitionMessagePrintExists' ], $options), |
|
39 | - new \Twig_SimpleFunction('msgExists', [ $this, 'intuitionMessageExists' ], $options), |
|
40 | - new \Twig_SimpleFunction('msg', [ $this, 'intuitionMessage' ], $options), |
|
41 | - new \Twig_SimpleFunction('lang', [ $this, 'getLang' ], $options), |
|
42 | - new \Twig_SimpleFunction('langName', [ $this, 'getLangName' ], $options), |
|
43 | - new \Twig_SimpleFunction('allLangs', [ $this, 'getAllLangs' ]), |
|
44 | - new \Twig_SimpleFunction('isRTL', [ $this, 'intuitionIsRTL' ]), |
|
45 | - new \Twig_SimpleFunction('isRTLLang', [ $this, 'intuitionIsRTLLang' ]), |
|
46 | - new \Twig_SimpleFunction('shortHash', [ $this, 'gitShortHash' ]), |
|
47 | - new \Twig_SimpleFunction('hash', [ $this, 'gitHash' ]), |
|
48 | - new \Twig_SimpleFunction('releaseDate', [ $this, 'gitDate' ]), |
|
49 | - new \Twig_SimpleFunction('enabled', [ $this, 'tabEnabled' ]), |
|
50 | - new \Twig_SimpleFunction('tools', [ $this, 'allTools' ]), |
|
51 | - new \Twig_SimpleFunction('color', [ $this, 'getColorList' ]), |
|
52 | - new \Twig_SimpleFunction('chartColor', [ $this, 'chartColor' ]), |
|
53 | - new \Twig_SimpleFunction('isWMFLabs', [ $this, 'isWMFLabs' ]), |
|
54 | - new \Twig_SimpleFunction('isSingleWiki', [ $this, 'isSingleWiki' ]), |
|
55 | - new \Twig_SimpleFunction('getReplagThreshold', [ $this, 'getReplagThreshold' ]), |
|
56 | - new \Twig_SimpleFunction('loadStylesheetsFromCDN', [ $this, 'loadStylesheetsFromCDN' ]), |
|
57 | - new \Twig_SimpleFunction('isWMFLabs', [ $this, 'isWMFLabs' ]), |
|
58 | - new \Twig_SimpleFunction('replag', [ $this, 'replag' ]), |
|
59 | - new \Twig_SimpleFunction('link', [ $this, 'link' ]), |
|
60 | - new \Twig_SimpleFunction('quote', [ $this, 'quote' ]), |
|
61 | - new \Twig_SimpleFunction('bugReportURL', [ $this, 'bugReportURL' ]), |
|
35 | + new \Twig_SimpleFunction('request_time', [$this, 'requestTime'], $options), |
|
36 | + new \Twig_SimpleFunction('memory_usage', [$this, 'requestMemory'], $options), |
|
37 | + new \Twig_SimpleFunction('year', [$this, 'generateYear'], $options), |
|
38 | + new \Twig_SimpleFunction('msgPrintExists', [$this, 'intuitionMessagePrintExists'], $options), |
|
39 | + new \Twig_SimpleFunction('msgExists', [$this, 'intuitionMessageExists'], $options), |
|
40 | + new \Twig_SimpleFunction('msg', [$this, 'intuitionMessage'], $options), |
|
41 | + new \Twig_SimpleFunction('lang', [$this, 'getLang'], $options), |
|
42 | + new \Twig_SimpleFunction('langName', [$this, 'getLangName'], $options), |
|
43 | + new \Twig_SimpleFunction('allLangs', [$this, 'getAllLangs']), |
|
44 | + new \Twig_SimpleFunction('isRTL', [$this, 'intuitionIsRTL']), |
|
45 | + new \Twig_SimpleFunction('isRTLLang', [$this, 'intuitionIsRTLLang']), |
|
46 | + new \Twig_SimpleFunction('shortHash', [$this, 'gitShortHash']), |
|
47 | + new \Twig_SimpleFunction('hash', [$this, 'gitHash']), |
|
48 | + new \Twig_SimpleFunction('releaseDate', [$this, 'gitDate']), |
|
49 | + new \Twig_SimpleFunction('enabled', [$this, 'tabEnabled']), |
|
50 | + new \Twig_SimpleFunction('tools', [$this, 'allTools']), |
|
51 | + new \Twig_SimpleFunction('color', [$this, 'getColorList']), |
|
52 | + new \Twig_SimpleFunction('chartColor', [$this, 'chartColor']), |
|
53 | + new \Twig_SimpleFunction('isWMFLabs', [$this, 'isWMFLabs']), |
|
54 | + new \Twig_SimpleFunction('isSingleWiki', [$this, 'isSingleWiki']), |
|
55 | + new \Twig_SimpleFunction('getReplagThreshold', [$this, 'getReplagThreshold']), |
|
56 | + new \Twig_SimpleFunction('loadStylesheetsFromCDN', [$this, 'loadStylesheetsFromCDN']), |
|
57 | + new \Twig_SimpleFunction('isWMFLabs', [$this, 'isWMFLabs']), |
|
58 | + new \Twig_SimpleFunction('replag', [$this, 'replag']), |
|
59 | + new \Twig_SimpleFunction('link', [$this, 'link']), |
|
60 | + new \Twig_SimpleFunction('quote', [$this, 'quote']), |
|
61 | + new \Twig_SimpleFunction('bugReportURL', [$this, 'bugReportURL']), |
|
62 | 62 | new \Twig_SimpleFunction('logged_in_user', [$this, 'functionLoggedInUser']), |
63 | 63 | new \Twig_SimpleFunction('isUserAnon', [$this, 'isUserAnon']), |
64 | 64 | new \Twig_SimpleFunction('nsName', [$this, 'nsName']), |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function requestTime($decimals = 3) |
75 | 75 | { |
76 | - return number_format(microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'], $decimals); |
|
76 | + return number_format(microtime(true)-$_SERVER['REQUEST_TIME_FLOAT'], $decimals); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function intuitionMessageExists($message = "") |
108 | 108 | { |
109 | - return $this->getIntuition()->msgExists($message, [ "domain" => "xtools" ]); |
|
109 | + return $this->getIntuition()->msgExists($message, ["domain" => "xtools"]); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function intuitionMessage($message = "", $vars = []) |
139 | 139 | { |
140 | - return $this->getIntuition()->msg($message, [ "domain" => "xtools", "variables" => $vars ]); |
|
140 | + return $this->getIntuition()->msg($message, ["domain" => "xtools", "variables" => $vars]); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | /** |
@@ -166,10 +166,10 @@ discard block |
||
166 | 166 | */ |
167 | 167 | public function getAllLangs() |
168 | 168 | { |
169 | - $messageFiles = glob($this->container->getParameter("kernel.root_dir") . '/../i18n/*.json'); |
|
169 | + $messageFiles = glob($this->container->getParameter("kernel.root_dir").'/../i18n/*.json'); |
|
170 | 170 | |
171 | 171 | $languages = array_values(array_unique(array_map( |
172 | - function ($filename) { |
|
172 | + function($filename) { |
|
173 | 173 | return basename($filename, '.json'); |
174 | 174 | }, |
175 | 175 | $messageFiles |
@@ -533,9 +533,9 @@ discard block |
||
533 | 533 | public function getFilters() |
534 | 534 | { |
535 | 535 | return [ |
536 | - new \Twig_SimpleFilter('capitalize_first', [ $this, 'capitalizeFirst' ]), |
|
537 | - new \Twig_SimpleFilter('percent_format', [ $this, 'percentFormat' ]), |
|
538 | - new \Twig_SimpleFilter('diff_format', [ $this, 'diffFormat' ], [ 'is_safe' => [ 'html' ] ]), |
|
536 | + new \Twig_SimpleFilter('capitalize_first', [$this, 'capitalizeFirst']), |
|
537 | + new \Twig_SimpleFilter('percent_format', [$this, 'percentFormat']), |
|
538 | + new \Twig_SimpleFilter('diff_format', [$this, 'diffFormat'], ['is_safe' => ['html']]), |
|
539 | 539 | ]; |
540 | 540 | } |
541 | 541 | |
@@ -562,10 +562,10 @@ discard block |
||
562 | 562 | if (!$denominator) { |
563 | 563 | $quotient = $numerator; |
564 | 564 | } else { |
565 | - $quotient = ( $numerator / $denominator ) * 100; |
|
565 | + $quotient = ($numerator / $denominator) * 100; |
|
566 | 566 | } |
567 | 567 | |
568 | - return round($quotient, $precision) . '%'; |
|
568 | + return round($quotient, $precision).'%'; |
|
569 | 569 | } |
570 | 570 | |
571 | 571 | /** |
@@ -640,20 +640,20 @@ discard block |
||
640 | 640 | |
641 | 641 | if ($seconds >= 86400) { |
642 | 642 | // Over a day |
643 | - $val = (int) floor($seconds / 86400); |
|
643 | + $val = (int)floor($seconds / 86400); |
|
644 | 644 | $key = 'days'; |
645 | 645 | } elseif ($seconds >= 3600) { |
646 | 646 | // Over an hour, less than a day |
647 | - $val = (int) floor($seconds / 3600); |
|
647 | + $val = (int)floor($seconds / 3600); |
|
648 | 648 | $key = 'hours'; |
649 | 649 | } elseif ($seconds >= 60) { |
650 | 650 | // Over a minute, less than an hour |
651 | - $val = (int) floor($seconds / 60); |
|
651 | + $val = (int)floor($seconds / 60); |
|
652 | 652 | $key = 'minutes'; |
653 | 653 | } |
654 | 654 | |
655 | 655 | if ($translate) { |
656 | - return number_format($val) . ' ' . $this->intuitionMessage("num-$key", [$val]); |
|
656 | + return number_format($val).' '.$this->intuitionMessage("num-$key", [$val]); |
|
657 | 657 | } else { |
658 | 658 | return [number_format($val), "num-$key"]; |
659 | 659 | } |