docs: Clarify that functions returning namespace names include underscores (not spaces)
Bug: T316092 Change-Id: I380e529590033e5d34adc37d21e8607feb4fab19
This commit is contained in:
parent
21304f90e8
commit
d64cbc17e9
4 changed files with 9 additions and 7 deletions
|
|
@ -1155,7 +1155,7 @@ class Title implements LinkTarget, PageIdentity, IDBAccessObject {
|
|||
/**
|
||||
* Get the namespace text
|
||||
*
|
||||
* @return string|false Namespace text
|
||||
* @return string|false Namespace name with underscores (not spaces), e.g. 'User_talk'
|
||||
*/
|
||||
public function getNsText() {
|
||||
if ( $this->isExternal() ) {
|
||||
|
|
@ -1185,7 +1185,7 @@ class Title implements LinkTarget, PageIdentity, IDBAccessObject {
|
|||
/**
|
||||
* Get the namespace text of the subject (rather than talk) page
|
||||
*
|
||||
* @return string Namespace text
|
||||
* @return string Namespace name with underscores (not spaces)
|
||||
*/
|
||||
public function getSubjectNsText() {
|
||||
$services = MediaWikiServices::getInstance();
|
||||
|
|
@ -1196,7 +1196,7 @@ class Title implements LinkTarget, PageIdentity, IDBAccessObject {
|
|||
/**
|
||||
* Get the namespace text of the talk page
|
||||
*
|
||||
* @return string Namespace text
|
||||
* @return string Namespace name with underscores (not spaces)
|
||||
*/
|
||||
public function getTalkNsText() {
|
||||
$services = MediaWikiServices::getInstance();
|
||||
|
|
|
|||
|
|
@ -595,9 +595,11 @@ class Language {
|
|||
/**
|
||||
* Get a namespace value by key
|
||||
*
|
||||
* Namespace name uses underscores (not spaces), e.g. 'MediaWiki_talk'.
|
||||
*
|
||||
* <code>
|
||||
* $mw_ns = $lang->getNsText( NS_MEDIAWIKI );
|
||||
* echo $mw_ns; // prints 'MediaWiki'
|
||||
* $mw_ns = $lang->getNsText( NS_MEDIAWIKI_TALK );
|
||||
* echo $mw_ns; // prints 'MediaWiki_talk'
|
||||
* </code>
|
||||
*
|
||||
* @param int $index The array key of the namespace to return
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser {
|
|||
* @param string $text
|
||||
*
|
||||
* @throws InvalidArgumentException If the namespace is invalid
|
||||
* @return string Namespace name with underscores (not spaces)
|
||||
* @return string Namespace name with underscores (not spaces), e.g. 'User_talk'
|
||||
*/
|
||||
public function getNamespaceName( $namespace, $text ) {
|
||||
if ( $this->language->needsGenderDistinction() &&
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ interface TitleFormatter {
|
|||
* @param string $text
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @return string
|
||||
* @return string Namespace name with underscores (not spaces), e.g. 'User_talk'
|
||||
*/
|
||||
public function getNamespaceName( $namespace, $text );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue