X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2Flanguage%2FcheckLanguage.inc;h=11b00e148ba0fffa99e374743b33c5f36029e7af;hb=be7d3feab2f5681eeec6787ef80ff73cfb9f7506;hp=13fbdaee8551f199d76dbbb426d47a1ee953caff;hpb=10ed39657b13f0a87a02e13e796eda078f3c641c;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/language/checkLanguage.inc b/maintenance/language/checkLanguage.inc index 13fbdaee85..11b00e148b 100644 --- a/maintenance/language/checkLanguage.inc +++ b/maintenance/language/checkLanguage.inc @@ -1,4 +1,25 @@ level === 0 ) { $this->L->getMessages( $code ); - return; + return $results; } - $results = array(); $checkFunctions = $this->getChecks(); $checkBlacklist = $this->getCheckBlacklist(); foreach ( $this->checks as $check ) { @@ -315,9 +336,9 @@ ENDS; /** * Format a message key. - * @param $key The message key. - * @param $code The language code. - * @return The formatted message key. + * @param $key string The message key. + * @param $code string The language code. + * @return string The formatted message key. */ protected function formatKey( $key, $code ) { if ( $this->doLinks ) { @@ -334,7 +355,6 @@ ENDS; /** * Output the checks results as plain text. - * @return The checks results as plain text. */ protected function outputText() { foreach ( $this->results as $code => $results ) { @@ -380,10 +400,8 @@ ENDS; /** * Output the checks results as wiki text. - * @return The checks results as wiki text. */ function outputWiki() { - global $wgContLang; $detailText = ''; $rows[] = '! Language !! Code !! Total !! ' . implode( ' !! ', array_diff( $this->checks, $this->nonMessageChecks() ) ); foreach ( $this->results as $code => $results ) { @@ -419,7 +437,7 @@ ENDS; # Don't list languages without problems continue; } - $language = $wgContLang->getLanguageName( $code ); + $language = Language::fetchLanguageName( $code ); $rows[] = "| $language || $code || $problems || " . implode( ' || ', $numbers ); } @@ -441,11 +459,11 @@ EOL; /** * Check if there are any results for the checks, in any language. - * @return True if there are any results, false if not. + * @return bool True if there are any results, false if not. */ protected function isEmpty() { - foreach( $this->results as $code => $results ) { - foreach( $results as $check => $messages ) { + foreach( $this->results as $results ) { + foreach( $results as $messages ) { if( !empty( $messages ) ) { return false; } @@ -463,8 +481,8 @@ class CheckExtensionsCLI extends CheckLanguageCLI { /** * Constructor. - * @param $options Options for script. - * @param $extension The extension name (or names). + * @param $options array Options for script. + * @param $extension string The extension name (or names). */ public function __construct( Array $options, $extension ) { if ( isset( $options['help'] ) ) { @@ -548,7 +566,7 @@ class CheckExtensionsCLI extends CheckLanguageCLI { /** * Get the default checks. - * @return A list of the default checks. + * @return array A list of the default checks. */ protected function defaultChecks() { return array( @@ -559,7 +577,7 @@ class CheckExtensionsCLI extends CheckLanguageCLI { /** * Get the checks which check other things than messages. - * @return A list of the non-message checks. + * @return array A list of the non-message checks. */ protected function nonMessageChecks() { return array(); @@ -567,7 +585,7 @@ class CheckExtensionsCLI extends CheckLanguageCLI { /** * Get the checks that can easily be treated by non-speakers of the language. - * @return A list of the easy checks. + * @return arrayA list of the easy checks. */ protected function easyChecks() { return array( @@ -577,7 +595,7 @@ class CheckExtensionsCLI extends CheckLanguageCLI { /** * Get help. - * @return The help string. + * @return string The help string. */ protected function help() { return <<extensions as $extension ) {