/**
* Get a cached or new language object for a given language code
- * @param $code String
+ * @param string $code
* @return Language
*/
static function factory( $code ) {
/**
* Create a language object for a given language code
- * @param $code String
+ * @param string $code
* @throws MWException
* @return Language
*/
* Based on regexes by Mark Davis of the Unicode Consortium:
* http://unicode.org/repos/cldr/trunk/tools/java/org/unicode/cldr/util/data/langtagRegex.txt
*
- * @param $code string
- * @param $lenient boolean Whether to allow '_' as separator. The default is only '-'.
+ * @param string $code
+ * @param bool $lenient Whether to allow '_' as separator. The default is only '-'.
*
* @return bool
* @since 1.21
* not it exists. This includes codes which are used solely for
* customisation via the MediaWiki namespace.
*
- * @param $code string
+ * @param string $code
*
* @return bool
*/
* Returns true if a language code is of a valid form for the purposes of
* internal customisation of MediaWiki, via Messages*.php or *.json.
*
- * @param $code string
+ * @param string $code
*
* @throws MWException
* @since 1.18
/**
* Returns true if a language code is an IETF tag known to MediaWiki.
*
- * @param $code string
+ * @param string $code
*
* @since 1.21
* @return bool
}
/**
- * @param $code
- * @return String Name of the language class
+ * @param string $code
+ * @return string Name of the language class
*/
public static function classFromCode( $code ) {
if ( $code == 'en' ) {
/**
* Includes language class files
*
- * @param $class string Name of the language class
+ * @param string $class Name of the language class
*/
public static function preloadLanguageClass( $class ) {
global $IP;
/**
* Arbitrarily set all of the namespace names at once. Mainly used for testing
- * @param $namespaces Array of namespaces (id => name)
+ * @param array $namespaces Array of namespaces (id => name)
*/
public function setNamespaces( array $namespaces ) {
$this->namespaceNames = $namespaces;
* echo $mw_ns; // prints 'MediaWiki'
* </code>
*
- * @param $index Int: the array key of the namespace to return
- * @return mixed, string if the namespace value exists, otherwise false
+ * @param int $index The array key of the namespace to return
+ * @return string|bool String if the namespace value exists, otherwise false
*/
function getNsText( $index ) {
$ns = $this->getNamespaces();
/**
* Returns gender-dependent namespace alias if available.
* See https://www.mediawiki.org/wiki/Manual:$wgExtraGenderNamespaces
- * @param $index Int: namespace index
- * @param $gender String: gender key (male, female... )
- * @return String
+ * @param int $index Namespace index
+ * @param string $gender Gender key (male, female... )
+ * @return string
* @since 1.18
*/
function getGenderNsText( $index, $gender ) {
* Only matches namespace names for the current language, not the
* canonical ones defined in Namespace.php.
*
- * @param $text String
- * @return mixed An integer if $text is a valid value otherwise false
+ * @param string $text
+ * @return int|bool An integer if $text is a valid value otherwise false
*/
function getLocalNsIndex( $text ) {
$lctext = $this->lc( $text );
* Get a namespace key by value, case insensitive. Canonical namespace
* names override custom ones defined for the current language.
*
- * @param $text String
- * @return mixed An integer if $text is a valid value otherwise false
+ * @param string $text
+ * @return int|bool An integer if $text is a valid value otherwise false
*/
function getNsIndex( $text ) {
$lctext = $this->lc( $text );
/**
* short names for language variants used for language conversion links.
*
- * @param $code String
- * @param $usemsg bool Use the "variantname-xyz" message if it exists
+ * @param string $code
+ * @param bool $usemsg Use the "variantname-xyz" message if it exists
* @return string
*/
function getVariantname( $code, $usemsg = true ) {
}
/**
- * @param $name string
+ * @param string $name
* @return string
*/
function specialPage( $name ) {
}
/**
- * @param $image
+ * @param string $image
* @return array|null
*/
function getImageFile( $image ) {
}
/**
- * @param $tog
+ * @param string $tog
* @return string
*/
function getUserToggle( $tog ) {
* Only those defined in MediaWiki, no other data like CLDR.
* If $customisedOnly is true, only returns codes with a messages file
*
- * @param $customisedOnly bool
+ * @param bool $customisedOnly
*
* @return array
* @deprecated since 1.20, use fetchLanguageNames()
* Get translated language names. This is done on best effort and
* by default this is exactly the same as Language::getLanguageNames.
* The CLDR extension provides translated names.
- * @param $code String Language code.
- * @return Array language code => language name
+ * @param string $code Language code.
+ * @return array Language code => language name
* @since 1.18.0
* @deprecated since 1.20, use fetchLanguageNames()
*/
/**
* Get an array of language names, indexed by code.
- * @param $inLanguage null|string: Code of language in which to return the names
+ * @param null|string $inLanguage Code of language in which to return the names
* Use null for autonyms (native names)
- * @param $include string:
+ * @param string $include One of:
* 'all' all available languages
* 'mw' only if the language is defined in MediaWiki or wgExtraLanguageNames (default)
* 'mwfile' only if the language is in 'mw' *and* has a message file
- * @return array: language code => language name
+ * @return array Language code => language name
* @since 1.20
*/
public static function fetchLanguageNames( $inLanguage = null, $include = 'mw' ) {
}
/**
- * @param $code string: The code of the language for which to get the name
- * @param $inLanguage null|string: Code of language in which to return the name (null for autonyms)
- * @param $include string: 'all', 'mw' or 'mwfile'; see fetchLanguageNames()
- * @return string: Language name or empty
+ * @param string $code The code of the language for which to get the name
+ * @param null|string $inLanguage Code of language in which to return the name (null for autonyms)
+ * @param string $include 'all', 'mw' or 'mwfile'; see fetchLanguageNames()
+ * @return string Language name or empty
* @since 1.20
*/
public static function fetchLanguageName( $code, $inLanguage = null, $include = 'all' ) {
/**
* Get a message from the MediaWiki namespace.
*
- * @param $msg String: message name
+ * @param string $msg Message name
* @return string
*/
function getMessageFromDB( $msg ) {
/**
* Get the native language name of $code.
* Only if defined in MediaWiki, no other data like CLDR.
- * @param $code string
+ * @param string $code
* @return string
* @deprecated since 1.20, use fetchLanguageName()
*/
}
/**
- * @param $key string
+ * @param string $key
* @return string
*/
function getMonthName( $key ) {
}
/**
- * @param $key string
+ * @param string $key
* @return string
*/
function getMonthNameGen( $key ) {
}
/**
- * @param $key string
+ * @param string $key
* @return string
*/
function getMonthAbbreviation( $key ) {
}
/**
- * @param $key string
+ * @param string $key
* @return string
*/
function getWeekdayName( $key ) {
}
/**
- * @param $key string
+ * @param string $key
* @return string
*/
function getWeekdayAbbreviation( $key ) {
}
/**
- * @param $key string
+ * @param string $key
* @return string
*/
function getIranianCalendarMonthName( $key ) {
}
/**
- * @param $key string
+ * @param string $key
* @return string
*/
function getHebrewCalendarMonthName( $key ) {
}
/**
- * @param $key string
+ * @param string $key
* @return string
*/
function getHebrewCalendarMonthNameGen( $key ) {
}
/**
- * @param $key string
+ * @param string $key
* @return string
*/
function getHijriCalendarMonthName( $key ) {
* time zone, if any. Note that the format characters crUeIOPTZ will assume
* $ts is UTC if $zone is not given.
*
- * @param $format String
- * @param $ts String: 14-character timestamp
+ * @param string $format
+ * @param string $ts 14-character timestamp
* YYYYMMDDHHMMSS
* 01234567890123
- * @param $zone DateTimeZone: Timezone of $ts
+ * @param DateTimeZone $zone Timezone of $ts
* @todo handling of "o" format character for Iranian, Hebrew, Hijri & Thai?
*
* @throws MWException
*
* Link: http://www.farsiweb.info/jalali/jalali.c
*
- * @param $ts string
+ * @param string $ts
*
* @return string
*/
*
* @see http://phpnuke.org/modules.php?name=News&file=article&sid=8234&mode=thread&order=0&thold=0
*
- * @param $ts string
+ * @param string $ts
*
* @return string
*/
* The months are counted from Tishrei = 1. In a leap year, Adar I is 13
* and Adar II is 14. In a non-leap year, Adar is 6.
*
- * @param $ts string
+ * @param string $ts
*
* @return string
*/
* Based on Carl Friedrich Gauss algorithm for finding Easter date.
* Used for Hebrew date.
*
- * @param $year int
+ * @param int $year
*
* @return string
*/
* http://en.wikipedia.org/wiki/Minguo_calendar
* http://en.wikipedia.org/wiki/Japanese_era_name
*
- * @param $ts String: 14-character timestamp
- * @param $cName String: calender name
- * @return Array: converted year, month, day
+ * @param string $ts 14-character timestamp
+ * @param string $cName Calender name
+ * @return array Converted year, month, day
*/
private static function tsToYear( $ts, $cName ) {
$gy = substr( $ts, 0, 4 );
/**
* Roman number formatting up to 10000
*
- * @param $num int
+ * @param int $num
*
* @return string
*/
/**
* Hebrew Gematria number formatting up to 9999
*
- * @param $num int
+ * @param int $num
*
* @return string
*/
/**
* Used by date() and time() to adjust the time output.
*
- * @param $ts Int the time in date('YmdHis') format
- * @param $tz Mixed: adjust the time by this amount (default false, mean we
- * get user timecorrection setting)
+ * @param int $ts The time in date('YmdHis') format
+ * @param mixed $tz Adjust the time by this amount (default false, mean we
+ * get user timecorrection setting)
* @return int
*/
function userAdjust( $ts, $tz = false ) {
* }
*</code>
*
- * @param $usePrefs Mixed: if true, the user's preference is used
- * if false, the site/language default is used
- * if int/string, assumed to be a format.
+ * @param int|string|bool $usePrefs If true, the user's preference is used
+ * if false, the site/language default is used
+ * if int/string, assumed to be a format.
* @return string
*/
function dateFormat( $usePrefs = true ) {
/**
* Get a format string for a given type and preference
- * @param $type string May be date, time or both
- * @param $pref string The format name as it appears in Messages*.php
+ * @param string $type May be date, time or both
+ * @param string $pref The format name as it appears in Messages*.php
*
* @since 1.22 New type 'pretty' that provides a more readable timestamp format
*
}
/**
- * @param $ts Mixed: the time format which needs to be turned into a
- * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
- * @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|bool the time offset as returned by
- * validateTimeZone() in Special:Preferences
+ * @param mixed $ts The time format which needs to be turned into a
+ * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
+ * @param bool $adj Whether to adjust the time output according to the
+ * user configured offset ($timecorrection)
+ * @param mixed $format True to use user's date format preference
+ * @param string|bool $timecorrection The time offset as returned by
+ * validateTimeZone() in Special:Preferences
* @return string
*/
function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
}
/**
- * @param $ts Mixed: the time format which needs to be turned into a
- * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
- * @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|bool the time offset as returned by
- * validateTimeZone() in Special:Preferences
+ * @param mixed $ts The time format which needs to be turned into a
+ * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
+ * @param bool $adj Whether to adjust the time output according to the
+ * user configured offset ($timecorrection)
+ * @param mixed $format True to use user's date format preference
+ * @param string|bool $timecorrection The time offset as returned by
+ * validateTimeZone() in Special:Preferences
* @return string
*/
function time( $ts, $adj = false, $format = true, $timecorrection = false ) {
}
/**
- * @param $ts Mixed: the time format which needs to be turned into a
- * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
- * @param $adj Bool: whether to adjust the time output according to the
- * user configured offset ($timecorrection)
- * @param $format Mixed: what format to return, if it's false output the
- * default one (default true)
- * @param $timecorrection String|bool the time offset as returned by
- * validateTimeZone() in Special:Preferences
+ * @param mixed $ts The time format which needs to be turned into a
+ * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
+ * @param bool $adj Whether to adjust the time output according to the
+ * user configured offset ($timecorrection)
+ * @param mixed $format What format to return, if it's false output the
+ * default one (default true)
+ * @param string|bool $timecorrection The time offset as returned by
+ * validateTimeZone() in Special:Preferences
* @return string
*/
function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false ) {
*
* @since 1.20
*
- * @param integer $seconds The amount of seconds.
+ * @param int $seconds The amount of seconds.
* @param array $chosenIntervals The intervals to enable.
*
* @return string
*
* @since 1.20
*
- * @param integer $seconds The amount of seconds.
+ * @param int $seconds The amount of seconds.
* @param array $chosenIntervals The intervals to enable.
*
* @return array
/**
* Internal helper function for userDate(), userTime() and userTimeAndDate()
*
- * @param $type String: can be 'date', 'time' or 'both'
- * @param $ts Mixed: the time format which needs to be turned into a
- * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
- * @param $user User object used to get preferences for timezone and format
- * @param $options Array, can contain the following keys:
- * - 'timecorrection': time correction, can have the following values:
- * - true: use user's preference
- * - false: don't use time correction
- * - integer: value of time correction in minutes
- * - 'format': format to use, can have the following values:
- * - true: use user's preference
- * - false: use default preference
- * - string: format to use
+ * @param string $type Can be 'date', 'time' or 'both'
+ * @param mixed $ts The time format which needs to be turned into a
+ * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
+ * @param User $user User object used to get preferences for timezone and format
+ * @param array $options Array, can contain the following keys:
+ * - 'timecorrection': time correction, can have the following values:
+ * - true: use user's preference
+ * - false: don't use time correction
+ * - int: value of time correction in minutes
+ * - 'format': format to use, can have the following values:
+ * - true: use user's preference
+ * - false: use default preference
+ * - string: format to use
* @since 1.19
- * @return String
+ * @return string
*/
private function internalUserTimeAndDate( $type, $ts, User $user, array $options ) {
$ts = wfTimestamp( TS_MW, $ts );
* Get the formatted date for the given timestamp and formatted for
* the given user.
*
- * @param $ts Mixed: the time format which needs to be turned into a
- * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
- * @param $user User object used to get preferences for timezone and format
- * @param $options Array, can contain the following keys:
- * - 'timecorrection': time correction, can have the following values:
- * - true: use user's preference
- * - false: don't use time correction
- * - integer: value of time correction in minutes
- * - 'format': format to use, can have the following values:
- * - true: use user's preference
- * - false: use default preference
- * - string: format to use
+ * @param mixed $ts Mixed: the time format which needs to be turned into a
+ * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
+ * @param User $user User object used to get preferences for timezone and format
+ * @param array $options Array, can contain the following keys:
+ * - 'timecorrection': time correction, can have the following values:
+ * - true: use user's preference
+ * - false: don't use time correction
+ * - int: value of time correction in minutes
+ * - 'format': format to use, can have the following values:
+ * - true: use user's preference
+ * - false: use default preference
+ * - string: format to use
* @since 1.19
- * @return String
+ * @return string
*/
public function userDate( $ts, User $user, array $options = array() ) {
return $this->internalUserTimeAndDate( 'date', $ts, $user, $options );
* Get the formatted time for the given timestamp and formatted for
* the given user.
*
- * @param $ts Mixed: the time format which needs to be turned into a
- * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
- * @param $user User object used to get preferences for timezone and format
- * @param $options Array, can contain the following keys:
- * - 'timecorrection': time correction, can have the following values:
- * - true: use user's preference
- * - false: don't use time correction
- * - integer: value of time correction in minutes
- * - 'format': format to use, can have the following values:
- * - true: use user's preference
- * - false: use default preference
- * - string: format to use
+ * @param mixed $ts The time format which needs to be turned into a
+ * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
+ * @param User $user User object used to get preferences for timezone and format
+ * @param array $options Array, can contain the following keys:
+ * - 'timecorrection': time correction, can have the following values:
+ * - true: use user's preference
+ * - false: don't use time correction
+ * - int: value of time correction in minutes
+ * - 'format': format to use, can have the following values:
+ * - true: use user's preference
+ * - false: use default preference
+ * - string: format to use
* @since 1.19
- * @return String
+ * @return string
*/
public function userTime( $ts, User $user, array $options = array() ) {
return $this->internalUserTimeAndDate( 'time', $ts, $user, $options );
* Get the formatted date and time for the given timestamp and formatted for
* the given user.
*
- * @param $ts Mixed: the time format which needs to be turned into a
- * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
- * @param $user User object used to get preferences for timezone and format
- * @param $options Array, can contain the following keys:
- * - 'timecorrection': time correction, can have the following values:
- * - true: use user's preference
- * - false: don't use time correction
- * - integer: value of time correction in minutes
- * - 'format': format to use, can have the following values:
- * - true: use user's preference
- * - false: use default preference
- * - string: format to use
+ * @param mixed $ts the time format which needs to be turned into a
+ * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
+ * @param User $user User object used to get preferences for timezone and format
+ * @param array $options Array, can contain the following keys:
+ * - 'timecorrection': time correction, can have the following values:
+ * - true: use user's preference
+ * - false: don't use time correction
+ * - int: value of time correction in minutes
+ * - 'format': format to use, can have the following values:
+ * - true: use user's preference
+ * - false: use default preference
+ * - string: format to use
* @since 1.19
- * @return String
+ * @return string
*/
public function userTimeAndDate( $ts, User $user, array $options = array() ) {
return $this->internalUserTimeAndDate( 'both', $ts, $user, $options );
}
/**
- * @param $key string
+ * @param string $key
* @return array|null
*/
function getMessage( $key ) {
}
/**
- * @param $in
- * @param $out
- * @param $string
+ * @param string $in
+ * @param string $out
+ * @param string $string
* @return string
*/
function iconv( $in, $out, $string ) {
// callback functions for uc(), lc(), ucwords(), ucwordbreaks()
/**
- * @param $matches array
+ * @param array $matches
* @return mixed|string
*/
function ucwordbreaksCallbackAscii( $matches ) {
}
/**
- * @param $matches array
+ * @param array $matches
* @return string
*/
function ucwordbreaksCallbackMB( $matches ) {
}
/**
- * @param $matches array
+ * @param array $matches
* @return string
*/
function ucCallback( $matches ) {
}
/**
- * @param $matches array
+ * @param array $matches
* @return string
*/
function lcCallback( $matches ) {
}
/**
- * @param $matches array
+ * @param array $matches
* @return string
*/
function ucwordsCallbackMB( $matches ) {
}
/**
- * @param $matches array
+ * @param array $matches
* @return string
*/
function ucwordsCallbackWiki( $matches ) {
/**
* Make a string's first character uppercase
*
- * @param $str string
+ * @param string $str
*
* @return string
*/
/**
* Convert a string to uppercase
*
- * @param $str string
- * @param $first bool
+ * @param string $str
+ * @param bool $first
*
* @return string
*/
}
/**
- * @param $str string
+ * @param string $str
* @return mixed|string
*/
function lcfirst( $str ) {
}
/**
- * @param $str string
- * @param $first bool
+ * @param string $str
+ * @param bool $first
* @return mixed|string
*/
function lc( $str, $first = false ) {
}
/**
- * @param $str string
+ * @param string $str
* @return bool
*/
function isMultibyte( $str ) {
}
/**
- * @param $str string
+ * @param string $str
* @return mixed|string
*/
function ucwords( $str ) {
/**
* capitalize words at word breaks
*
- * @param $str string
+ * @param string $str
* @return mixed
*/
function ucwordbreaks( $str ) {
* uses this function when it should be using a more general normalisation
* function, then fix the caller.
*
- * @param $s string
+ * @param string $s
*
* @return string
*/
}
/**
- * @param $s string
+ * @param string $s
* @return string
*/
function checkTitleEncoding( $s ) {
* Some languages such as Chinese require word segmentation,
* Specify such segmentation when overridden in derived class.
*
- * @param $string String
- * @return String
+ * @param string $string
+ * @return string
*/
function segmentByWord( $string ) {
return $string;
* Some languages have special punctuation need to be normalized.
* Make such changes here.
*
- * @param $string String
- * @return String
+ * @param string $string
+ * @return string
*/
function normalizeForSearch( $string ) {
return self::convertDoubleWidth( $string );
* convert double-width roman characters to single-width.
* range: ff00-ff5f ~= 0020-007f
*
- * @param $string string
+ * @param string $string
*
* @return string
*/
}
/**
- * @param $string string
- * @param $pattern string
+ * @param string $string
+ * @param string $pattern
* @return string
*/
protected static function insertSpace( $string, $pattern ) {
}
/**
- * @param $termsArray array
+ * @param array $termsArray
* @return array
*/
function convertForSearchResult( $termsArray ) {
/**
* Get the first character of a string.
*
- * @param $s string
+ * @param string $s
* @return string
*/
function firstChar( $s ) {
}
/**
- * @param $s string
+ * @param string $s
* @return string
*/
function recodeForEdit( $s ) {
}
/**
- * @param $s string
+ * @param string $s
* @return string
*/
function recodeInput( $s ) {
*
* This is language-specific for performance reasons only.
*
- * @param $s string
+ * @param string $s
*
* @return string
*/
* The data is cached in process memory. This will go faster if you have the
* FastStringSearch extension.
*
- * @param $file string
- * @param $string string
+ * @param string $file
+ * @param string $string
*
* @throws MWException
* @return string
/**
* Return the correct HTML 'dir' attribute value for this language.
- * @return String
+ * @return string
*/
function getDir() {
return $this->isRTL() ? 'rtl' : 'ltr';
*
* Should be equivalent to CSS3 'start' text-align value....
*
- * @return String
+ * @return string
*/
function alignStart() {
return $this->isRTL() ? 'right' : 'left';
*
* Should be equivalent to CSS3 'end' text-align value....
*
- * @return String
+ * @return string
*/
function alignEnd() {
return $this->isRTL() ? 'left' : 'right';
* because it makes the output HTML source code more readable. When
* the output is plain text or can be escaped, getDirMark() should be used.
*
- * @param $opposite Boolean Get the direction mark opposite to your language
+ * @param bool $opposite Get the direction mark opposite to your language
* @return string
* @since 1.20
*/
* when the output is plain text or can be escaped. When the output is
* HTML, use getDirMarkEntity() instead.
*
- * @param $opposite Boolean Get the direction mark opposite to your language
+ * @param bool $opposite Get the direction mark opposite to your language
* @return string
*/
function getDirMark( $opposite = false ) {
/**
* An arrow, depending on the language direction.
*
- * @param $direction String: the direction of the arrow: forwards (default), backwards, left, right, up, down.
+ * @param string $direction The direction of the arrow: forwards (default), backwards, left, right, up, down.
* @return string
*/
function getArrow( $direction = 'forwards' ) {
/**
* Fill a MagicWord object with data from here
*
- * @param $mw
+ * @param MagicWord $mw
*/
function getMagic( $mw ) {
// Saves a function call
/**
* Add magic words to the extension array
*
- * @param $newWords array
+ * @param array $newWords
*/
function addMagicWordsByLang( $newWords ) {
$fallbackChain = $this->getFallbackLanguages();
/**
* Italic is unsuitable for some languages
*
- * @param $text String: the text to be emphasized.
+ * @param string $text The text to be emphasized.
* @return string
*/
function emphasize( $text ) {
* See $separatorTransformTable on MessageIs.php for
* the , => . and . => , implementation.
*
- * @todo check if it's viable to use localeconv() for the decimal
- * separator thing.
- * @param $number Mixed: the string to be formatted, should be an integer
- * or a floating point number.
- * @param $nocommafy Bool: set to true for special numbers like dates
+ * @todo check if it's viable to use localeconv() for the decimal separator thing.
+ * @param int|float $number The string to be formatted, should be an integer
+ * or a floating point number.
+ * @param bool $nocommafy Set to true for special numbers like dates
* @return string
*/
public function formatNum( $number, $nocommafy = false ) {
/**
* Front-end for non-commafied formatNum
*
- * @param mixed $number the string to be formatted, should be an integer
+ * @param int|float $number The string to be formatted, should be an integer
* or a floating point number.
* @since 1.21
* @return string
}
/**
- * @param $number string
+ * @param string $number
* @return string
*/
function parseFormattedNumber( $number ) {
/**
* Adds commas to a given number
* @since 1.19
- * @param $number mixed
+ * @param mixed $number
* @return string
*/
function commafy( $number ) {
}
/**
- * @return String
+ * @return string
*/
function digitGroupingPattern() {
return self::$dataCache->getItem( $this->mCode, 'digitGroupingPattern' );
* The last two strings are chained with an "and".
* NOTE: This function will only work with standard numeric array keys (0, 1, 2…)
*
- * @param $l Array
+ * @param string[] $l
* @return string
*/
function listToText( array $l ) {
/**
* Take a list of strings and build a locale-friendly comma-separated
* list, using the local comma-separator message.
- * @param $list array of strings to put in a comma list
+ * @param string[] $list Array of strings to put in a comma list
* @return string
*/
function commaList( array $list ) {
/**
* Take a list of strings and build a locale-friendly semicolon-separated
* list, using the local semicolon-separator message.
- * @param $list array of strings to put in a semicolon list
+ * @param string[] $list Array of strings to put in a semicolon list
* @return string
*/
function semicolonList( array $list ) {
/**
* Same as commaList, but separate it with the pipe instead.
- * @param $list array of strings to put in a pipe list
+ * @param string[] $list Array of strings to put in a pipe list
* @return string
*/
function pipeList( array $list ) {
*
* If $length is negative, the string will be truncated from the beginning
*
- * @param $string String to truncate
- * @param $length Int: maximum length (including ellipses)
- * @param $ellipsis String to append to the truncated text
- * @param $adjustLength Boolean: Subtract length of ellipsis from $length.
+ * @param string $string String to truncate
+ * @param int $length Maximum length (including ellipses)
+ * @param string $ellipsis String to append to the truncated text
+ * @param bool $adjustLength Subtract length of ellipsis from $length.
* $adjustLength was introduced in 1.18, before that behaved as if false.
* @return string
*/
* Remove bytes that represent an incomplete Unicode character
* at the end of string (e.g. bytes of the char are missing)
*
- * @param $string String
+ * @param string $string
* @return string
*/
protected function removeBadCharLast( $string ) {
* Remove bytes that represent an incomplete Unicode character
* at the start of string (e.g. bytes of the char are missing)
*
- * @param $string String
+ * @param string $string
* @return string
*/
protected function removeBadCharFirst( $string ) {
* truncateHtml() helper function
* like strcspn() but adds the skipped chars to $ret
*
- * @param $ret
- * @param $text
- * @param $search
- * @param $start
- * @param $len
+ * @param string $ret
+ * @param string $text
+ * @param string $search
+ * @param int $start
+ * @param null|int $len
* @return int
*/
private function truncate_skip( &$ret, $text, $search, $start, $len = null ) {
* truncateHtml() helper function
* (a) push or pop $tag from $openTags as needed
* (b) clear $tag value
- * @param &$tag string Current HTML tag name we are looking at
- * @param $tagType int (0-open tag, 1-close tag)
- * @param $lastCh string Character before the '>' that ended this tag
- * @param &$openTags array Open tag stack (not accounting for $tag)
+ * @param string &$tag Current HTML tag name we are looking at
+ * @param int $tagType (0-open tag, 1-close tag)
+ * @param string $lastCh Character before the '>' that ended this tag
+ * @param array &$openTags Open tag stack (not accounting for $tag)
*/
private function truncate_endBracket( &$tag, $tagType, $lastCh, &$openTags ) {
$tag = ltrim( $tag );
* Grammatical transformations, needed for inflected languages
* Invoked by putting {{grammar:case|word}} in a message
*
- * @param $word string
- * @param $case string
+ * @param string $word
+ * @param string $case
* @return string
*/
function convertGrammar( $word, $case ) {
}
/**
* Get the grammar forms for the content language
- * @return array of grammar forms
+ * @return array Array of grammar forms
* @since 1.20
*/
function getGrammarForms() {
* If fewer than three forms are given, the default is to use the first (masculine) form.
* These details can be overridden in subclasses.
*
- * @param $gender string
- * @param $forms array
+ * @param string $gender
+ * @param array $forms
*
* @return string
*/
*
* Example: {{plural:{{NUMBEROFARTICLES}}|article|articles}}
*
- * @param $count Integer: non-localized number
- * @param $forms Array: different plural forms
+ * @param int $count Non-localized number
+ * @param array $forms Different plural forms
* @return string Correct form of plural for $count in this language
*/
function convertPlural( $count, $forms ) {
* Checks that convertPlural was given an array and pads it to requested
* amount of forms by copying the last one.
*
- * @param $count Integer: How many forms should there be at least
- * @param $forms Array of forms given to convertPlural
+ * @param int $count How many forms should there be at least
+ * @param array $forms Array of forms given to convertPlural
* @return array Padded array of forms or an exception if not an array
*/
protected function preConvertPlural( /* Array */ $forms, $count ) {
* on old expiry lengths recorded in log entries. You'd need to provide the start date to
* match up with it.
*
- * @param $str String: the validated block duration in English
+ * @param string $str The validated block duration in English
* @return string Somehow translated block duration
* @see LanguageFi.php for example implementation
*/
* languages like Chinese need to be segmented in order for the diff
* to be of any use
*
- * @param $text String
- * @return String
+ * @param string $text
+ * @return string
*/
public function segmentForDiff( $text ) {
return $text;
/**
* and unsegment to show the result
*
- * @param $text String
- * @return String
+ * @param string $text
+ * @return string
*/
public function unsegmentForDiff( $text ) {
return $text;
/**
* convert text to all supported variants
*
- * @param $text string
+ * @param string $text
* @return array
*/
public function autoConvertToAllVariants( $text ) {
/**
* convert text to different variants of a language.
*
- * @param $text string
+ * @param string $text
* @return string
*/
public function convert( $text ) {
/**
* Convert a Title object to a string in the preferred variant
*
- * @param $title Title
+ * @param Title $title
* @return string
*/
public function convertTitle( $title ) {
/**
* Convert a namespace index to a string in the preferred variant
*
- * @param $ns int
+ * @param int $ns
* @return string
*/
public function convertNamespace( $ns ) {
* Check if the language has the specific variant
*
* @since 1.19
- * @param $variant string
+ * @param string $variant
* @return bool
*/
public function hasVariant( $variant ) {
/**
* Put custom tags (e.g. -{ }-) around math to prevent conversion
*
- * @param $text string
+ * @param string $text
* @return string
* @deprecated since 1.22 is no longer used
*/
/**
* Perform output conversion on a string, and encode for safe HTML output.
- * @param $text String text to be converted
- * @param $isTitle Bool whether this conversion is for the article title
+ * @param string $text Text to be converted
+ * @param bool $isTitle Whether this conversion is for the article title
* @return string
* @todo this should get integrated somewhere sane
*/
}
/**
- * @param $key string
+ * @param string $key
* @return string
*/
public function convertCategoryKey( $key ) {
* actually exists in another variant. this function
* tries to find it. See e.g. LanguageZh.php
*
- * @param $link String: the name of the link
- * @param $nt Mixed: the title object of the link
- * @param $ignoreOtherCond Boolean: to disable other conditions when
- * we need to transclude a template or update a category's link
+ * @param string $link The name of the link
+ * @param Title $nt The title object of the link
+ * @param bool $ignoreOtherCond To disable other conditions when
+ * we need to transclude a template or update a category's link
* @return null the input parameters may be modified upon return
*/
public function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
* This function is called "markNoConversion" for historical
* reasons.
*
- * @param $text String: text to be used for external link
- * @param $noParse bool: wrap it without confirming it's a real URL first
- * @return string the tagged text
+ * @param string $text Text to be used for external link
+ * @param bool $noParse Wrap it without confirming it's a real URL first
+ * @return string The tagged text
*/
public function markNoConversion( $text, $noParse = false ) {
// Excluding protocal-relative URLs may avoid many false positives.
}
/**
- * @param $code string
+ * @param string $code
*/
public function setCode( $code ) {
$this->mCode = $code;
/**
* Get the name of a file for a certain language code
- * @param $prefix string Prepend this to the filename
- * @param $code string Language code
- * @param $suffix string Append this to the filename
+ * @param string $prefix Prepend this to the filename
+ * @param string $code Language code
+ * @param string $suffix Append this to the filename
* @throws MWException
* @return string $prefix . $mangledCode . $suffix
*/
/**
* Get the language code from a file name. Inverse of getFileName()
- * @param $filename string $prefix . $languageCode . $suffix
- * @param $prefix string Prefix before the language code
- * @param $suffix string Suffix after the language code
+ * @param string $filename $prefix . $languageCode . $suffix
+ * @param string $prefix Prefix before the language code
+ * @param string $suffix Suffix after the language code
* @return string Language code, or false if $prefix or $suffix isn't found
*/
public static function getCodeFromFileName( $filename, $prefix = 'Language', $suffix = '.php' ) {
}
/**
- * @param $code string
+ * @param string $code
* @return string
*/
public static function getMessagesFileName( $code ) {
}
/**
- * @param $code string
+ * @param string $code
* @return string
* @since 1.23
*/
}
/**
- * @param $code string
+ * @param string $code
* @return string
*/
public static function getClassFileName( $code ) {
/**
* Get the first fallback for a given language.
*
- * @param $code string
+ * @param string $code
*
* @return bool|string
*/
* Get the ordered list of fallback languages.
*
* @since 1.19
- * @param $code string Language code
+ * @param string $code Language code
* @return array
*/
public static function getFallbacksFor( $code ) {
* WARNING: this may take a long time. If you just need all message *keys*
* but need the *contents* of only a few messages, consider using getMessageKeysFor().
*
- * @param $code string
+ * @param string $code
*
* @return array
*/
/**
* Get a message for a given language
*
- * @param $key string
- * @param $code string
+ * @param string $key
+ * @param string $code
*
* @return string
*/
* array_keys( Language::getMessagesFor( $code ) )
*
* @since 1.19
- * @param $code string Language code
+ * @param string $code Language code
* @return array of message keys (strings)
*/
public static function getMessageKeysFor( $code ) {
}
/**
- * @param $talk
+ * @param string $talk
* @return mixed
*/
function fixVariableInNamespace( $talk ) {
}
/**
- * @param $m string
+ * @param string $m
* @return string
*/
function replaceGrammarInNamespace( $m ) {
*
* @todo FIXME: why are we returnings DBMS-dependent strings???
*
- * @param $expiry String: Database expiry String
- * @param $format Bool|Int true to process using language functions, or TS_ constant
+ * @param string $expiry Database expiry String
+ * @param bool|int $format True to process using language functions, or TS_ constant
* to return the expiry in a given timestamp
- * @return String
+ * @return string
* @since 1.18
*/
public function formatExpiry( $expiry, $format = true ) {
/**
* @todo Document
- * @param $seconds int|float
- * @param $format Array Optional
+ * @param int|float $seconds
+ * @param array $format Optional
* If $format['avoid'] == 'avoidseconds' - don't mention seconds if $seconds >= 1 hour
* If $format['avoid'] == 'avoidminutes' - don't mention seconds/minutes if $seconds > 48 hours
* If $format['noabbrevs'] is true - use 'seconds' and friends instead of 'seconds-abbrev' and friends
* This use base 1000. For base 1024 use formatSize(), for another base
* see formatComputingNumbers()
*
- * @param $bps int
+ * @param int $bps
* @return string
*/
function formatBitrate( $bps ) {
}
/**
- * @param $size int Size of the unit
- * @param $boundary int Size boundary (1000, or 1024 in most cases)
- * @param $messageKey string Message key to be uesd
+ * @param int $size Size of the unit
+ * @param int $boundary Size boundary (1000, or 1024 in most cases)
+ * @param string $messageKey Message key to be uesd
* @return string
*/
function formatComputingNumbers( $size, $boundary, $messageKey ) {
* This method use base 1024. For base 1000 use formatBitrate(), for
* another base see formatComputingNumbers()
*
- * @param $size int Size to format
+ * @param int $size Size to format
* @return string Plain text (not HTML)
*/
function formatSize( $size ) {
/**
* Make a list item, used by various special pages
*
- * @param $page String Page link
- * @param $details String Text between brackets
- * @param $oppositedm Boolean Add the direction mark opposite to your
- * language, to display text properly
- * @return String
+ * @param string $page Page link
+ * @param string $details Text between brackets
+ * @param bool $oppositedm Add the direction mark opposite to your
+ * language, to display text properly
+ * @return string
*/
function specialList( $page, $details, $oppositedm = true ) {
$dirmark = ( $oppositedm ? $this->getDirMark( true ) : '' ) .
/**
* Generate (prev x| next x) (20|50|100...) type links for paging
*
- * @param $title Title object to link
- * @param $offset Integer offset parameter
- * @param $limit Integer limit parameter
- * @param $query array|String optional URL query parameter string
- * @param $atend Bool optional param for specified if this is the last page
- * @return String
+ * @param Title $title Title object to link
+ * @param int $offset
+ * @param int $limit
+ * @param array|string $query Optional URL query parameter string
+ * @param bool $atend Optional param for specified if this is the last page
+ * @return string
*/
public function viewPrevNext( Title $title, $offset, $limit, array $query = array(), $atend = false ) {
// @todo FIXME: Why on earth this needs one message for the text and another one for tooltip?
/**
* Helper function for viewPrevNext() that generates links
*
- * @param $title Title object to link
- * @param $offset Integer offset parameter
- * @param $limit Integer limit parameter
- * @param $query Array extra query parameters
- * @param $link String text to use for the link; will be escaped
- * @param $tooltipMsg String name of the message to use as tooltip
- * @param $class String value of the "class" attribute of the link
- * @return String HTML fragment
+ * @param Title $title Title object to link
+ * @param int $offset
+ * @param int $limit
+ * @param array $query Extra query parameters
+ * @param string $link Text to use for the link; will be escaped
+ * @param string $tooltipMsg Name of the message to use as tooltip
+ * @param string $class Value of the "class" attribute of the link
+ * @return string HTML fragment
*/
private function numLink( Title $title, $offset, $limit, array $query, $link, $tooltipMsg, $class ) {
$query = array( 'limit' => $limit, 'offset' => $offset ) + $query;