From 454f98526f02e3fd961380ae45e63e309e0ce864 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 29 May 2011 16:32:43 +0000 Subject: [PATCH] More documentation! --- languages/Language.php | 8 ++++---- languages/LanguageConverter.php | 24 ++++++++++++++++++------ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/languages/Language.php b/languages/Language.php index fbd3c7f464..0429890cfc 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1721,7 +1721,7 @@ class Language { * @param $adj Bool: whether to adjust the time output according to the * user configured offset ($timecorrection) * @param $format Mixed: true to use user's date format preference - * @param $timecorrection String: the time offset as returned by + * @param $timecorrection String|bool the time offset as returned by * validateTimeZone() in Special:Preferences * @return string */ @@ -1740,7 +1740,7 @@ class Language { * @param $adj Bool: whether to adjust the time output according to the * user configured offset ($timecorrection) * @param $format Mixed: true to use user's date format preference - * @param $timecorrection String: the time offset as returned by + * @param $timecorrection String|bool the time offset as returned by * validateTimeZone() in Special:Preferences * @return string */ @@ -1760,7 +1760,7 @@ class Language { * user configured offset ($timecorrection) * @param $format Mixed: what format to return, if it's false output the * default one (default true) - * @param $timecorrection String: the time offset as returned by + * @param $timecorrection String|bool the time offset as returned by * validateTimeZone() in Special:Preferences * @return string */ @@ -2756,7 +2756,7 @@ class Language { * @param string $text HTML string to truncate * @param int $length (zero/positive) Maximum length (including ellipses) * @param string $ellipsis String to append to the truncated text - * @returns string + * @return string */ function truncateHtml( $text, $length, $ellipsis = '...' ) { # Use the localized ellipsis character diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php index 59fed23695..0abab57b0f 100644 --- a/languages/LanguageConverter.php +++ b/languages/LanguageConverter.php @@ -305,9 +305,9 @@ class LanguageConverter { * If you want to parse rules, try to use convert() or * convertTo(). * - * @param $text String: the text to be converted - * @param $toVariant String: the target language code - * @return String: the converted text + * @param $text String the text to be converted + * @param $toVariant bool|string the target language code + * @return String the converted text */ public function autoConvert( $text, $toVariant = false ) { wfProfileIn( __METHOD__ ); @@ -481,7 +481,7 @@ class LanguageConverter { /** * Apply manual conversion rules. * - * @param $convRule Object: Object of ConverterRule + * @param $convRule ConverterRule Object of ConverterRule */ protected function applyManualConv( $convRule ) { // Use syntax -{T|zh-cn:TitleCN; zh-tw:TitleTw}- to custom @@ -521,7 +521,7 @@ class LanguageConverter { * Auto convert a Title object to a readable string in the * preferred variant. * - * @param $title Object: a object of Title + * @param $title Title a object of Title * @return String: converted title text */ public function convertTitle( $title ) { @@ -622,7 +622,9 @@ class LanguageConverter { * * @param $text String: text to be converted * @param $variant String: the target variant code + * @param $startPos int * @param $depth Integer: depth of recursion + * * @return String: converted text */ protected function recursiveConvertRule( $text, $variant, &$startPos, $depth = 0 ) { @@ -993,6 +995,10 @@ class LanguageConverter { /** * Convert the sorting key for category links. This should make different * keys that are variants of each other map to the same key. + * + * @param $key string + * + * @return string */ function convertCategoryKey( $key ) { return $key; @@ -1003,7 +1009,7 @@ class LanguageConverter { * MediaWiki:Conversiontable* is updated. * @private * - * @param $article Object: Article object + * @param $article Article object * @param $user Object: User object for the current user * @param $text String: article text (?) * @param $summary String: edit summary of the edit @@ -1260,6 +1266,8 @@ class ConverterRule { * Parse rules conversion. * @private * + * @param $variant + * * @return string */ function getRuleConvertedStr( $variant ) { @@ -1486,6 +1494,7 @@ class ConverterRule { /** * Return how deal with conversion rules. + * @return string */ public function getRulesAction() { return $this->mRulesAction; @@ -1494,6 +1503,7 @@ class ConverterRule { /** * Get conversion table. (bidirectional and unidirectional * conversion table) + * @return array */ public function getConvTable() { return $this->mConvTable; @@ -1501,6 +1511,7 @@ class ConverterRule { /** * Get conversion rules string. + * @return string */ public function getRules() { return $this->mRules; @@ -1508,6 +1519,7 @@ class ConverterRule { /** * Get conversion flags. + * @return array */ public function getFlags() { return $this->mFlags; -- 2.20.1