/**
* Date for the HTTP header Last-modified
- * @var string|false $mLastModified
+ * @var string|bool $mLastModified
*/
private $mLastModified;
private $mText;
/**
- * @param $text string|null
+ * @param string|null $text
*/
function __construct( $text = null ) {
$this->mCacheDuration = null;
/**
* Set the number of seconds to get the response cached by a proxy
- * @param $duration int
+ * @param int $duration
*/
function setCacheDuration( $duration ) {
$this->mCacheDuration = $duration;
/**
* Set the HTTP Vary header
- * @param $vary string
+ * @param string $vary
*/
function setVary( $vary ) {
$this->mVary = $vary;
/**
* Set the HTTP response code
- * @param $code string
+ * @param string $code
*/
function setResponseCode( $code ) {
$this->mResponseCode = $code;
/**
* Set the HTTP header Content-Type
- * @param $type string
+ * @param string $type
*/
function setContentType( $type ) {
$this->mContentType = $type;
/**
* Add content to the response
- * @param $text string
+ * @param string $text
*/
function addText( $text ) {
if ( ! $this->mDisabled && $text ) {
* possible. If successful, the AjaxResponse is disabled so that
* any future call to AjaxResponse::printText() have no effect.
*
- * @param $timestamp string
+ * @param string $timestamp
* @return bool Returns true if the response code was set to 304 Not Modified.
*/
function checkLastModified( $timestamp ) {
}
/**
- * @param $mckey string
- * @param $touched int
+ * @param string $mckey
+ * @param int $touched
* @return bool
*/
function loadFromMemcached( $mckey, $touched ) {
}
/**
- * @param $mckey string
- * @param $expiry int
+ * @param string $mckey
+ * @param int $expiry
* @return bool
*/
function storeInMemcached( $mckey, $expiry = 86400 ) {
* Sets if the cache should be enabled or not.
*
* @since 1.20
- * @param boolean $cacheEnabled
+ * @param bool $cacheEnabled
*/
function setCacheEnabled( $cacheEnabled );
*
* @since 1.20
*
- * @param integer|null $cacheExpiry Sets the cache expiry, either ttl in seconds or unix timestamp.
- * @param boolean|null $cacheEnabled Sets if the cache should be enabled or not.
+ * @param int|null $cacheExpiry Sets the cache expiry, either ttl in seconds or unix timestamp.
+ * @param bool|null $cacheEnabled Sets if the cache should be enabled or not.
*/
function startCache( $cacheExpiry = null, $cacheEnabled = null );
*
* @since 1.20
*
- * @param integer $cacheExpiry
+ * @param int $cacheExpiry
*/
function setExpiry( $cacheExpiry );
}
* The time to live for the cache, in seconds or a unix timestamp indicating the point of expiry.
*
* @since 1.20
- * @var integer
+ * @var int
*/
protected $cacheExpiry = 3600;
* Null if this information is not available yet.
*
* @since 1.20
- * @var boolean|null
+ * @var bool|null
*/
protected $hasCached = null;
* If the cache is enabled or not.
*
* @since 1.20
- * @var boolean
+ * @var bool
*/
protected $cacheEnabled = true;
* Sets if the cache should be enabled or not.
*
* @since 1.20
- * @param boolean $cacheEnabled
+ * @param bool $cacheEnabled
*/
public function setCacheEnabled( $cacheEnabled ) {
$this->cacheEnabled = $cacheEnabled;
*
* @since 1.20
*
- * @param integer|null $cacheExpiry Sets the cache expiry, either ttl in seconds or unix timestamp.
- * @param boolean|null $cacheEnabled Sets if the cache should be enabled or not.
+ * @param int|null $cacheExpiry Sets the cache expiry, either ttl in seconds or unix timestamp.
+ * @param bool|null $cacheEnabled Sets if the cache should be enabled or not.
*/
public function startCache( $cacheExpiry = null, $cacheEnabled = null ) {
if ( is_null( $this->hasCached ) ) {
* @since 1.20
*
* @param IContextSource $context
- * @param boolean $includePurgeLink
+ * @param bool $includePurgeLink
*
* @return string
*/
*
* @since 1.20
*
- * @param integer $cacheExpiry
+ * @param int $cacheExpiry
*/
public function setExpiry( $cacheExpiry ) {
$this->cacheExpiry = $cacheExpiry;
*
* @since 1.20
*
- * @param $handlerFunction
+ * @param callable $handlerFunction
*/
public function setOnInitializedHandler( $handlerFunction ) {
$this->onInitHandler = $handlerFunction;
$imgsNoGallery;
/**
- * @var Array
+ * @var array
*/
var $nextPage;
/**
- * @var Array
+ * @var array
*/
var $flip;
* Constructor
*
* @since 1.19 $context is a second, required parameter
- * @param $title Title
- * @param $context IContextSource
+ * @param Title $title
+ * @param IContextSource $context
* @param array $from An array with keys page, subcat,
* and file for offset of results of each section (since 1.17)
* @param array $until An array with 3 keys for until of each section (since 1.17)
- * @param $query Array
+ * @param array $query
*/
function __construct( $title, IContextSource $context, $from = array(),
$until = array(), $query = array()
/**
* Add a subcategory to the internal lists, using a Category object
- * @param $cat Category
- * @param $sortkey
- * @param $pageLength
+ * @param Category $cat
+ * @param string $sortkey
+ * @param int $pageLength
*/
function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) {
// Subcategory; strip the 'Category' namespace from the link text.
/**
* Add a page in the image namespace
- * @param $title Title
- * @param $sortkey
- * @param $pageLength
- * @param $isRedirect bool
+ * @param Title $title
+ * @param string $sortkey
+ * @param int $pageLength
+ * @param bool $isRedirect
*/
function addImage( Title $title, $sortkey, $pageLength, $isRedirect = false ) {
global $wgContLang;
/**
* Add a miscellaneous page
- * @param $title
- * @param $sortkey
- * @param $pageLength
- * @param $isRedirect bool
+ * @param Title $title
+ * @param string $sortkey
+ * @param int $pageLength
+ * @param bool $isRedirect
*/
function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) {
global $wgContLang;
* Format a list of articles chunked by letter, either as a
* bullet list or a columnar format, depending on the length.
*
- * @param $articles Array
- * @param $articles_start_char Array
- * @param $cutoff Int
- * @return String
+ * @param array $articles
+ * @param array $articles_start_char
+ * @param int $cutoff
+ * @return string
* @private
*/
function formatList( $articles, $articles_start_char, $cutoff = 6 ) {
* More distant TODO: Scrap this and use CSS columns, whenever IE finally
* supports those.
*
- * @param $articles Array
- * @param $articles_start_char Array
- * @return String
+ * @param array $articles
+ * @param array $articles_start_char
+ * @return string
* @private
*/
static function columnList( $articles, $articles_start_char ) {
/**
* Format a list of articles chunked by letter in a bullet list.
- * @param $articles Array
- * @param $articles_start_char Array
- * @return String
+ * @param array $articles
+ * @param array $articles_start_char
+ * @return string
* @private
*/
static function shortList( $articles, $articles_start_char ) {
* @param string $last The 'from' parameter for the generated URL
* @param string $type A prefix for parameters, 'page' or 'subcat' or
* 'file'
- * @return String HTML
+ * @return string HTML
*/
private function pagingLinks( $first, $last, $type = '' ) {
$prevLink = $this->msg( 'prevn' )->numParams( $this->limit )->escaped();
/**
* Has a summary been preset using GET parameter &summary= ?
- * @var Bool
+ * @var bool
*/
var $hasPresetSummary = false;
public $allowNonTextContent = false;
/**
- * @param $article Article
+ * @param Article $article
*/
public function __construct( Article $article ) {
$this->mArticle = $article;
/**
* Set the context Title object
*
- * @param $title Title object or null
+ * @param Title|null $title Title object or null
*/
public function setContextTitle( $title ) {
$this->mContextTitle = $title;
* If not set, $wgTitle will be returned. This behavior might change in
* the future to return $this->mTitle instead.
*
- * @return Title object
+ * @return Title
*/
public function getContextTitle() {
if ( is_null( $this->mContextTitle ) ) {
* "View source for ..." page displaying the source code after the error message.
*
* @since 1.19
- * @param array $permErrors of permissions errors, as returned by
- * Title::getUserPermissionsErrors().
+ * @param array $permErrors Array of permissions errors, as returned by
+ * Title::getUserPermissionsErrors().
* @throws PermissionsError
*/
protected function displayPermissionsError( array $permErrors ) {
/**
* This function collects the form data and uses it to populate various member variables.
- * @param $request WebRequest
+ * @param WebRequest $request
* @throws ErrorPageError
*/
function importFormData( &$request ) {
* this method should be overridden and return the page text that will be used
* for saving, preview parsing and so on...
*
- * @param $request WebRequest
+ * @param WebRequest $request
*/
protected function importContentFormData( &$request ) {
return; // Don't do anything, EditPage already extracted wpTextbox1
/**
* Initialise form fields in the object
* Called on the first invocation, e.g. when a user clicks an edit link
- * @return bool -- if the requested section is valid
+ * @return bool If the requested section is valid
*/
function initialiseForm() {
global $wgUser;
/**
* Fetch initial editing page content.
*
- * @param $def_text string|bool
- * @return mixed string on success, $def_text for invalid sections
+ * @param string|bool $def_text
+ * @return string|bool string on success, $def_text for invalid sections
* @private
* @deprecated since 1.21, get WikiPage::getContent() instead.
*/
/**
* @param Content|null $def_content The default value to return
*
- * @return mixed Content on success, $def_content for invalid sections
+ * @return Content|null Content on success, $def_content for invalid sections
*
* @since 1.21
*/
/**
* Use this method before edit() to preload some text into the edit box
*
- * @param $text string
+ * @param string $text
* @deprecated since 1.21, use setPreloadedContent() instead.
*/
public function setPreloadedText( $text ) {
/**
* Use this method before edit() to preload some content into the edit box
*
- * @param $content Content
+ * @param Content $content
*
* @since 1.21
*/
*
* @param string $preload representing the title to preload from.
*
- * @return String
+ * @return string
*
* @deprecated since 1.21, use getPreloadedContent() instead
*/
* Get the contents to be preloaded into the box, either set by
* an earlier setPreloadText() or by loading the given page.
*
- * @param string $preload representing the title to preload from.
- * @param Array $params Parameters to use (interface-message style) in the preloaded text
+ * @param string $preload Representing the title to preload from.
+ * @param array $params Parameters to use (interface-message style) in the preloaded text
*
* @return Content
*
/**
* Make sure the form isn't faking a user's credentials.
*
- * @param $request WebRequest
+ * @param WebRequest $request
* @return bool
* @private
*/
/**
* Run hooks that can filter edits just before they get saved.
*
- * @param Content $content the Content to filter.
+ * @param Content $content The Content to filter.
* @param Status $status For reporting the outcome to the caller
* @param User $user The user performing the edit
*
/**
* Attempt submission (no UI)
*
- * @param array $result array to add statuses to, currently with the possible keys:
+ * @param array $result Array to add statuses to, currently with the possible keys:
* spam - string - Spam string from content if any spam is detected by matchSpamRegex
* sectionanchor - string - Section anchor for a section save
* nullEdit - boolean - Set if doEditContent is OK. True if null edit, false otherwise.
* redirect - boolean - Set if doEditContent is OK. True if resulting revision is a redirect
* @param bool $bot True if edit is being made under the bot right.
*
- * @return Status object, possibly with a message, but always with one of the AS_* constants in $status->value,
+ * @return Status Status object, possibly with a message, but always with one of the AS_* constants in $status->value,
*
* FIXME: This interface is TERRIBLE, but hard to get rid of due to various error display idiosyncrasies. There are
* also lots of cases where error metadata is set in the object and retrieved later instead of being returned, e.g.
/**
* Attempts to merge text content with base and current revisions
*
- * @param $editText string
+ * @param string $editText
*
* @return bool
* @deprecated since 1.21, use mergeChangesIntoContent() instead
*
* @since 1.21
*
- * @param $editContent
+ * @param Content $editContent
*
* @return bool
*/
/**
* Check given input text against $wgSpamRegex, and return the text of the first match.
*
- * @param $text string
+ * @param string $text
*
- * @return string|bool matching string or false
+ * @return string|bool Matching string or false
*/
public static function matchSpamRegex( $text ) {
global $wgSpamRegex;
/**
* Check given input text against $wgSummarySpamRegex, and return the text of the first match.
*
- * @param $text string
+ * @param string $text
*
- * @return string|bool matching string or false
+ * @return string|bool Matching string or false
*/
public static function matchSummarySpamRegex( $text ) {
global $wgSummarySpamRegex;
}
/**
- * @param $text string
- * @param $regexes array
+ * @param string $text
+ * @param array $regexes
* @return bool|string
*/
protected static function matchSpamRegexInternal( $text, $regexes ) {
* content.
*
* @param Content|null|bool|string $content
- * @return String the editable text form of the content.
+ * @return string The editable text form of the content.
*
* @throws MWException if $content is not an instance of TextContent and $this->allowNonTextContent is not true.
*/
/**
* Send the edit form and related headers to $wgOut
- * @param $formCallback Callback|null that takes an OutputPage parameter; will be called
+ * @param callable|null $formCallback That takes an OutputPage parameter; will be called
* during form output near the top, for captchas and the like.
*/
function showEditForm( $formCallback = null ) {
* Extract the section title from current section text, if any.
*
* @param string $text
- * @return Mixed|string or false
+ * @return string|bool string or false
*/
public static function extractSectionTitle( $text ) {
preg_match( "/^(=+)(.+)\\1\\s*(\n|$)/i", $text, $matches );
*
* @param string $summary The value of the summary input
* @param string $labelText The html to place inside the label
- * @param array $inputAttrs of attrs to use on the input
- * @param array $spanLabelAttrs of attrs to use on the span inside the label
+ * @param array $inputAttrs Array of attrs to use on the input
+ * @param array $spanLabelAttrs Array of attrs to use on the span inside the label
*
* @return array An array in the format array( $label, $input )
*/
* @param bool $isSubjectPreview true if this is the section subject/title
* up top, or false if this is the comment summary
* down below the textarea
- * @param string $summary the text of the summary to display
+ * @param string $summary The text of the summary to display
* @return string
*/
protected function getSummaryPreview( $isSubjectPreview, $summary = "" ) {
* The $textoverride method can be used by subclasses overriding showContentForm
* to pass back to this method.
*
- * @param array $customAttribs of html attributes to use in the textarea
- * @param string $textoverride optional text to override $this->textarea1 with
+ * @param array $customAttribs Array of html attributes to use in the textarea
+ * @param string $textoverride Optional text to override $this->textarea1 with
*/
protected function showTextbox1( $customAttribs = null, $textoverride = null ) {
if ( $this->wasDeletedSinceLastEdit() && $this->formtype == 'save' ) {
* Append preview output to $wgOut.
* Includes category rendering if this is a category page.
*
- * @param string $text the HTML to be output for the preview.
+ * @param string $text The HTML to be output for the preview.
*/
protected function showPreview( $text ) {
global $wgOut;
* Get the copyright warning, by default returns wikitext
*
* @param Title $title
- * @param string $format output format, valid values are any function of
- * a Message object
+ * @param string $format Output format, valid values are any function of a Message object
* @return string
*/
public static function getCopyrightWarning( $title, $format = 'plain' ) {
* variable in the constructor is not enough. This can be used when the
* EditPage lives inside of a Special page rather than a custom page action.
*
- * @param $title Title object for which is being edited (where we go to for &action= links)
+ * @param Title $title Title object for which is being edited (where we go to for &action= links)
* @return string
*/
protected function getActionURL( Title $title ) {
* Note that we rely on the logging table, which hasn't been always there,
* but that doesn't matter, because this only applies to brand new
* deletes.
+ * @return bool
*/
protected function wasDeletedSinceLastEdit() {
if ( $this->deletedSinceEdit !== null ) {
}
/**
- * @return Array
+ * @return array
*/
function getTemplates() {
if ( $this->preview || $this->section != '' ) {
* minor and watch
*
* @param int $tabindex Current tabindex
- * @param array $checked of checkbox => bool, where bool indicates the checked
+ * @param array $checked Array of checkbox => bool, where bool indicates the checked
* status of the checkbox
*
* @return array
/**
* Show "your edit contains spam" page with your diff and text
*
- * @param $match string|Array|bool Text (or array of texts) which triggered one or more filters
+ * @param string|array|bool $match Text (or array of texts) which triggered one or more filters
*/
public function spamPageWithContent( $match = false ) {
global $wgOut, $wgLang;
class Fallback {
/**
- * @param $from
- * @param $to
- * @param $string
+ * @param string $from
+ * @param string $to
+ * @param string $string
* @return string
*/
public static function iconv( $from, $to, $string ) {
* can be up to 100x slower than native if the text is heavily
* multibyte and we have to slog through a few hundred kb.
*
- * @param $str
- * @param $start
- * @param $count string
+ * @param string $str
+ * @param int $start
+ * @param string $count
*
* @return string
*/
}
/**
- * @param $str
- * @param $splitPos
+ * @param string $str
+ * @param int $splitPos
* @return int
*/
public static function mb_substr_split_unicode( $str, $splitPos ) {
/**
* Fallback implementation of mb_strlen, hardcoded to UTF-8.
* @param string $str
- * @param string $enc optional encoding; ignored
+ * @param string $enc Optional encoding; ignored
* @return int
*/
public static function mb_strlen( $str, $enc = '' ) {
/**
* Fallback implementation of mb_strpos, hardcoded to UTF-8.
- * @param $haystack String
- * @param $needle String
- * @param string $offset optional start position
- * @param string $encoding optional encoding; ignored
+ * @param string $haystack
+ * @param string $needle
+ * @param string $offset Optional start position
+ * @param string $encoding Optional encoding; ignored
* @return int
*/
public static function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
/**
* Fallback implementation of mb_strrpos, hardcoded to UTF-8.
- * @param $haystack String
- * @param $needle String
+ * @param string $haystack
+ * @param string $needle
* @param string $offset optional start position
* @param string $encoding optional encoding; ignored
* @return int
* Constructor
*
* @param string|Title $title Item's title
- * @param $description String
+ * @param string $description
* @param string $url URL uniquely designating the item.
* @param string $date Item's date
* @param string $author Author's user name
- * @param $comments String
+ * @param string $comments
*/
function __construct( $title, $description, $url, $date = '', $author = '', $comments = '' ) {
$this->title = $title;
/**
* Encode $string so that it can be safely embedded in a XML document
*
- * @param string $string string to encode
- * @return String
+ * @param string $string String to encode
+ * @return string
*/
public function xmlEncode( $string ) {
$string = str_replace( "\r\n", "\n", $string );
/**
* Get the unique id of this item
*
- * @return String
+ * @return string
*/
public function getUniqueId() {
if ( $this->uniqueId ) {
/**
* set the unique id of an item
*
- * @param string $uniqueId unique id for the item
- * @param $rssIsPermalink Boolean: set to true if the guid (unique id) is a permalink (RSS feeds only)
+ * @param string $uniqueId Unique id for the item
+ * @param bool $rssIsPermalink Set to true if the guid (unique id) is a permalink (RSS feeds only)
*/
public function setUniqueId( $uniqueId, $rssIsPermalink = false ) {
$this->uniqueId = $uniqueId;
/**
* Get the title of this item; already xml-encoded
*
- * @return String
+ * @return string
*/
public function getTitle() {
return $this->xmlEncode( $this->title );
/**
* Get the URL of this item; already xml-encoded
*
- * @return String
+ * @return string
*/
public function getUrl() {
return $this->xmlEncode( $this->url );
/**
* Get the description of this item; already xml-encoded
*
- * @return String
+ * @return string
*/
public function getDescription() {
return $this->xmlEncode( $this->description );
/**
* Get the language of this item
*
- * @return String
+ * @return string
*/
public function getLanguage() {
global $wgLanguageCode;
/**
* Get the title of this item
*
- * @return String
+ * @return string
*/
public function getDate() {
return $this->date;
/**
* Get the author of this item; already xml-encoded
*
- * @return String
+ * @return string
*/
public function getAuthor() {
return $this->xmlEncode( $this->author );
/**
* Get the comment of this item; already xml-encoded
*
- * @return String
+ * @return string
*/
public function getComments() {
return $this->xmlEncode( $this->comments );
* Quickie hack... strip out wikilinks to more legible form from the comment.
*
* @param string $text wikitext
- * @return String
+ * @return string
*/
public static function stripComment( $text ) {
return preg_replace( '/\[\[([^]]*\|)?([^]]+)\]\]/', '\2', $text );
* @code
* print "<feed>";
* @endcode
- * @param $item
*/
abstract public function outHeader();
* @code
* print "<item>...</item>";
* @endcode
- * @param $item
+ * @param FeedItem $item
*/
abstract public function outItem( $item );
/**
* Format a date given a timestamp
*
- * @param $ts Integer: timestamp
- * @return String: date string
+ * @param int $ts Timestamp
+ * @return string Date string
*/
function formatTime( $ts ) {
return gmdate( 'D, d M Y H:i:s \G\M\T', wfTimestamp( TS_UNIX, $ts ) );
/**
* Output an RSS 2.0 item
- * @param $item FeedItem: item to be output
+ * @param FeedItem $item Item to be output
*/
function outItem( $item ) {
?>
/**
* Output a given item.
- * @param $item
+ * @param FeedItem $item
*/
function outItem( $item ) {
global $wgMimeType;
* You must call setLocation() on the stub object before storing it to the
* database
*
- * @param $text string
+ * @param string $text
*
- * @return String: the key for getItem()
+ * @return string The key for getItem()
*/
function addItem( $text );
/**
* Get item by key, or false if the key is not present
*
- * @param $key string
+ * @param string $key
*
- * @return String or false
+ * @return string|bool
*/
function getItem( $key );
*
* Default text is not required for two-part external storage URLs.
*
- * @param $text string
+ * @param string $text
*/
function setText( $text );
/**
* Get default text. This is called from Revision::getRevisionText()
*
- * @return String
+ * @return string
*/
function getText();
}
}
/**
- * @param $text string
+ * @param string $text
* @return string
*/
public function addItem( $text ) {
}
/**
- * @param $hash string
+ * @param string $hash
* @return array|bool
*/
public function getItem( $hash ) {
}
/**
- * @param $text string
+ * @param string $text
* @return void
*/
public function setText( $text ) {
/**
* Remove an item
*
- * @param $hash string
+ * @param string $hash
*/
public function removeItem( $hash ) {
$this->mSize -= strlen( $this->mItems[$hash] );
var $mOldId, $mHash, $mRef;
/**
- * @param string $hash the content hash of the text
- * @param $oldid Integer the old_id for the CGZ object
+ * @param string $hash The content hash of the text
+ * @param int $oldid The old_id for the CGZ object
*/
function __construct( $hash = '', $oldid = 0 ) {
$this->mHash = $hash;
/**
* Sets the location (old_id) of the main object to which this object
* points
+ * @param int $id
*/
function setLocation( $id ) {
$this->mOldId = $id;
/**
* Sets the location (old_id) of the referring object
+ * @param string $id
*/
function setReferrer( $id ) {
$this->mRef = $id;
/**
* Gets the location of the referring object
+ * @return string
*/
function getReferrer() {
return $this->mRef;
var $mCurId;
/**
- * @param $curid Integer: the cur_id pointed to
+ * @param int $curid The cur_id pointed to
*/
function __construct( $curid = 0 ) {
$this->mCurId = $curid;
* Sets the location (cur_id) of the main object to which this object
* points
*
- * @param $id int
+ * @param int $id
*/
function setLocation( $id ) {
$this->mCurId = $id;
/**
* @throws MWException
- * @param $text string
+ * @param string $text
* @return int
*/
function addItem( $text ) {
}
/**
- * @param $key string
+ * @param string $key
* @return string
*/
function getItem( $key ) {
}
/**
- * @param $text string
+ * @param string $text
*/
function setText( $text ) {
$this->mDefaultKey = $this->addItem( $text );
}
/**
- * @param $t1
- * @param $t2
+ * @param string $t1
+ * @param string $t2
* @return string
*/
function diff( $t1, $t2 ) {
}
/**
- * @param $base
- * @param $diff
+ * @param string $base
+ * @param string $diff
* @return bool|string
*/
function patch( $base, $diff ) {
* the bytes backwards and initialised with 0 instead of 1. See bug 34428.
*
* @param string $s
- * @return string|bool: false if the hash extension is not available
+ * @return string|bool false if the hash extension is not available
*/
function xdiffAdler32( $s ) {
if ( !function_exists( 'hash' ) ) {
* Identical to rawElement(), but HTML-escapes $contents (like
* Xml::element()).
*
- * @param $element string
- * @param $attribs array
- * @param $contents string
+ * @param string $element
+ * @param array $attribs
+ * @param string $contents
*
* @return string
*/
* Identical to rawElement(), but has no third parameter and omits the end
* tag (and the self-closing '/' in XML mode for empty elements).
*
- * @param $element string
- * @param $attribs array
+ * @param string $element
+ * @param array $attribs
*
* @return string
*/
* to the input array (currently per the HTML 5 draft as of 2009-09-06).
*
* @param string $element Name of the element, e.g., 'a'
- * @param array $attribs Associative array of attributes, e.g., array(
+ * @param array $attribs Associative array of attributes, e.g., array(
* 'href' => 'http://www.mediawiki.org/' ). See expandAttributes() for
* further documentation.
* @return array An array of attributes functionally identical to $attribs
* Output a "<script>" tag linking to the given URL, e.g.,
* "<script src=foo.js></script>".
*
- * @param $url string
+ * @param string $url
* @return string Raw HTML
*/
public static function linkedScript( $url ) {
* contains literal "</style>" (admittedly unlikely).
*
* @param string $contents CSS
- * @param $media mixed A media type string, like 'screen'
+ * @param string $media A media type string, like 'screen'
* @return string Raw HTML
*/
public static function inlineStyle( $contents, $media = 'all' ) {
* Output a "<link rel=stylesheet>" linking to the given URL for the given
* media type (if any).
*
- * @param $url string
- * @param $media mixed A media type string, like 'screen'
+ * @param string $url
+ * @param string $media A media type string, like 'screen'
* @return string Raw HTML
*/
public static function linkedStyle( $url, $media = 'all' ) {
/**
* Get HTML for an info box with an icon.
*
- * @param string $text wikitext, get this with wfMessage()->plain()
- * @param string $icon icon name, file in skins/common/images
- * @param string $alt alternate text for the icon
- * @param string $class additional class name to add to the wrapper div
- * @param $useStylePath
+ * @param string $text Wikitext, get this with wfMessage()->plain()
+ * @param string $icon Icon name, file in skins/common/images
+ * @param string $alt Alternate text for the icon
+ * @param string $class Additional class name to add to the wrapper div
+ * @param bool $useStylePath
*
* @return string
*/
* to avoid attacks on intranet services accessible by HTTP.
* - userAgent A user agent, if you want to override the default
* MediaWiki/$wgVersion
- * @return Mixed: (bool)false on failure or a string on success
+ * @return string|bool (bool)false on failure or a string on success
*/
public static function request( $method, $url, $options = array() ) {
wfDebug( "HTTP: $method: $url\n" );
* Simple wrapper for Http::request( 'GET' )
* @see Http::request()
*
- * @param $url
- * @param $timeout string
- * @param $options array
+ * @param string $url
+ * @param string $timeout
+ * @param array $options
* @return string
*/
public static function get( $url, $timeout = 'default', $options = array() ) {
* Simple wrapper for Http::request( 'POST' )
* @see Http::request()
*
- * @param $url
- * @param $options array
+ * @param string $url
+ * @param array $options
* @return string
*/
public static function post( $url, $options = array() ) {
/**
* Check if the URL can be served by localhost
*
- * @param string $url full url to check
- * @return Boolean
+ * @param string $url Full url to check
+ * @return bool
*/
public static function isLocalURL( $url ) {
global $wgCommandLineMode, $wgConf;
/**
* A standard user-agent we can use for external requests.
- * @return String
+ * @return string
*/
public static function userAgent() {
global $wgVersion;
*
* @todo FIXME this is wildly inaccurate and fails to actually check most stuff
*
- * @param $uri Mixed: URI to check for validity
- * @return Boolean
+ * @param string $uri URI to check for validity
+ * @return bool
*/
public static function isValidURI( $uri ) {
return preg_match(
public $status;
/**
- * @param string $url url to use. If protocol-relative, will be expanded to an http:// URL
+ * @param string $url Url to use. If protocol-relative, will be expanded to an http:// URL
* @param array $options (optional) extra params to pass (see Http::request())
*/
protected function __construct( $url, $options = array() ) {
/**
* Generate a new request object
- * @param string $url url to use
+ * @param string $url Url to use
* @param array $options (optional) extra params to pass (see Http::request())
* @throws MWException
* @return CurlHttpRequest|PhpHttpRequest
/**
* Get the body, or content, of the response to the request
*
- * @return String
+ * @return string
*/
public function getContent() {
return $this->content;
/**
* Set the parameters of the request
*
- * @param $args Array
+ * @param array $args
* @todo overload the args param
*/
public function setData( $args ) {
/**
* Set the user agent
- * @param $UA string
+ * @param string $UA
*/
public function setUserAgent( $UA ) {
$this->setHeader( 'User-Agent', $UA );
/**
* Set an arbitrary header
- * @param $name
- * @param $value
+ * @param string $name
+ * @param string $value
*/
public function setHeader( $name, $value ) {
// I feel like I should normalize the case here...
* bytes are reported handled than were passed to you, the HTTP fetch
* will be aborted.
*
- * @param $callback Callback
+ * @param callable $callback
* @throws MWException
*/
public function setCallback( $callback ) {
* A generic callback to read the body of the response from a remote
* server.
*
- * @param $fh handle
- * @param $content String
+ * @param resource $fh
+ * @param string $content
* @return int
*/
public function read( $fh, $content ) {
* (see RFC2616, section 10, http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
* for a list of status codes.)
*
- * @return Integer
+ * @return int
*/
public function getStatus() {
if ( !$this->respHeaders ) {
/**
* Returns true if the last status code was a redirect.
*
- * @return Boolean
+ * @return bool
*/
public function isRedirect() {
if ( !$this->respHeaders ) {
* (e.g. Set-Cookie) can appear more than once the, each value of
* the associative array is an array of the values given.
*
- * @return Array
+ * @return array
*/
public function getResponseHeaders() {
if ( !$this->respHeaders ) {
/**
* Returns the value of the given response header.
*
- * @param $header String
- * @return String
+ * @param string $header
+ * @return string
*/
public function getResponseHeader( $header ) {
if ( !$this->respHeaders ) {
/**
* Tells the MWHttpRequest object to use this pre-loaded CookieJar.
*
- * @param $jar CookieJar
+ * @param CookieJar $jar
*/
public function setCookieJar( $jar ) {
$this->cookieJar = $jar;
* cookies. Used internally after a request to parse the
* Set-Cookie headers.
* @see Cookie::set
- * @param $name
- * @param $value null
- * @param $attr null
+ * @param string $name
+ * @param mixed $value
+ * @param array $attr
*/
public function setCookie( $name, $value = null, $attr = null ) {
if ( !$this->cookieJar ) {
protected $headerText = "";
/**
- * @param $fh
- * @param $content
+ * @param resource $fh
+ * @param string $content
* @return int
*/
protected function readHeader( $fh, $content ) {
class PhpHttpRequest extends MWHttpRequest {
/**
- * @param $url string
+ * @param string $url
* @return string
*/
protected function urlToTcp( $url ) {
var $mExtraDescription = false;
/**
- * @param $title Title
+ * @param Title $title
* @return WikiFilePage
*/
protected function newPage( Title $title ) {
/**
* Constructor from a page id
- * @param int $id article ID to load
+ * @param int $id Article ID to load
* @return ImagePage|null
*/
public static function newFromID( $id ) {
}
/**
- * @param $file File:
+ * @param File $file
* @return void
*/
public function setFile( $file ) {
/**
* Create the TOC
*
- * @param $metadata Boolean: whether or not to show the metadata link
- * @return String
+ * @param bool $metadata Whether or not to show the metadata link
+ * @return string
*/
protected function showTOC( $metadata ) {
$r = array(
*
* @todo FIXME: Bad interface, see note on MediaHandler::formatMetadata().
*
- * @param array $metadata the array containing the Exif data
- * @return String The metadata table. This is treated as Wikitext (!)
+ * @param array $metadata The array containing the Exif data
+ * @return string The metadata table. This is treated as Wikitext (!)
*/
protected function makeMetadataTable( $metadata ) {
$r = "<div class=\"mw-imagepage-section-metadata\">";
/**
* Creates an thumbnail of specified size and returns an HTML link to it
* @param array $params Scaler parameters
- * @param $width int
- * @param $height int
+ * @param int $width
+ * @param int $height
* @return string
*/
private function makeSizeLink( $params, $width, $height ) {
}
/**
- * @param $target
- * @param $limit
+ * @param string $target
+ * @param int $limit
* @return ResultWrapper
*/
protected function queryImageLinks( $target, $limit ) {
/**
* Display an error with a wikitext description
*
- * @param $description String
+ * @param string $description
*/
function showError( $description ) {
$out = $this->getContext()->getOutput();
* Callback for usort() to do link sorts by (namespace, title)
* Function copied from Title::compare()
*
- * @param $a object page to compare with
- * @param $b object page to compare with
- * @return Integer: result of string comparison, or namespace comparison
+ * @param object $a Object page to compare with
+ * @param object $b Object page to compare with
+ * @return int Result of string comparison, or namespace comparison
*/
protected function compare( $a, $b ) {
if ( $a->page_namespace == $b->page_namespace ) {
/**
* Returns the corresponding $wgImageLimits entry for the selected user option
*
- * @param $user User
+ * @param User $user
* @param string $optionName Name of a option to check, typically imagesize or thumbsize
* @return array
* @since 1.21
/**
* Output a drop-down box for language options for the file
*
- * @param Array $langChoices Array of string language codes
- * @param String $curLang Language code file is being viewed in.
- * @param String $defaultLang Language code that image is rendered in by default
- * @return String HTML to insert underneath image.
+ * @param array $langChoices Array of string language codes
+ * @param string $curLang Language code file is being viewed in.
+ * @param string $defaultLang Language code that image is rendered in by default
+ * @return string HTML to insert underneath image.
*/
protected function doRenderLangOpt( array $langChoices, $curLang, $defaultLang ) {
global $wgScript;
}
/**
- * @param $navLinks string
+ * @param string $navLinks
* @return string
*/
public function beginImageHistoryList( $navLinks = '' ) {
}
/**
- * @param $navLinks string
+ * @param string $navLinks
* @return string
*/
public function endImageHistoryList( $navLinks = '' ) {
}
/**
- * @param $iscur
- * @param $file File
+ * @param bool $iscur
+ * @param File $file
* @return string
*/
public function imageHistoryLine( $iscur, $file ) {
}
/**
- * @param $file File
+ * @param File $file
* @return string
*/
protected function getThumbForLine( $file ) {
}
/**
- * @param $enable bool
+ * @param bool $enable
*/
protected function preventClickjacking( $enable = true ) {
$this->preventClickjacking = $enable;
}
/**
- * @param $row object
+ * @param object $row
* @return string
*/
function formatRow( $row ) {
}
/**
- * @param $enable bool
+ * @param bool $enable
*/
protected function preventClickjacking( $enable = true ) {
$this->preventClickjacking = $enable;
* Get the appropriate HTML attributes to add to the "a" element of an
* external link, as created by [wikisyntax].
*
- * @param string $class the contents of the class attribute; if an empty
+ * @param string $class The contents of the class attribute; if an empty
* string is passed, which is the default value, defaults to 'external'.
* @return string
* @deprecated since 1.18 Just pass the external class directly to something using Html::expandAttributes
/**
* Get the appropriate HTML attributes to add to the "a" element of an interwiki link.
*
- * @param string $title the title text for the link, URL-encoded (???) but
+ * @param string $title The title text for the link, URL-encoded (???) but
* not HTML-escaped
- * @param string $unused unused
- * @param string $class the contents of the class attribute; if an empty
+ * @param string $unused Unused
+ * @param string $class The contents of the class attribute; if an empty
* string is passed, which is the default value, defaults to 'external'.
* @return string
*/
/**
* Get the appropriate HTML attributes to add to the "a" element of an internal link.
*
- * @param string $title the title text for the link, URL-encoded (???) but
+ * @param string $title The title text for the link, URL-encoded (???) but
* not HTML-escaped
- * @param string $unused unused
- * @param string $class the contents of the class attribute, default none
+ * @param string $unused Unused
+ * @param string $class The contents of the class attribute, default none
* @return string
*/
static function getInternalLinkAttributes( $title, $unused = null, $class = '' ) {
* Get the appropriate HTML attributes to add to the "a" element of an internal
* link, given the Title object for the page we want to link to.
*
- * @param $nt Title
+ * @param Title $nt
* @param string $unused Unused
* @param string $class The contents of the class attribute, default none
* @param string|bool $title Optional (unescaped) string to use in the title
/**
* Common code for getLinkAttributesX functions
*
- * @param $title string
- * @param $class string
+ * @param string $title
+ * @param string $class
*
* @return string
*/
/**
* Returns the Url used to link to a Title
*
- * @param $target Title
+ * @param Title $target
* @param array $query query parameters
- * @param $options Array
- * @return String
+ * @param array $options
+ * @return string
*/
private static function linkUrl( $target, $query, $options ) {
wfProfileIn( __METHOD__ );
/**
* Returns the array of attributes used when linking to the Title $target
*
- * @param $target Title
- * @param $attribs
- * @param $options
+ * @param Title $target
+ * @param array $attribs
+ * @param array $options
*
* @return array
*/
/**
* Default text of the links to the Title $target
*
- * @param $target Title
+ * @param Title $target
*
* @return string
*/
* as the bold link text. The calling sequence is the same as the other make*LinkObj static functions,
* despite $query not being used.
*
- * @param $nt Title
+ * @param Title $nt
* @param string $html [optional]
* @param string $query [optional]
* @param string $trail [optional]
* This should be called after a method like Title::makeTitleSafe() returned
* a value indicating that the title object is invalid.
*
- * @param $context IContextSource context to use to get the messages
+ * @param IContextSource $context Context to use to get the messages
* @param int $namespace Namespace number
* @param string $title Text of the title, without the namespace part
* @return string
}
/**
- * @param $title Title
+ * @param Title $title
* @return Title
*/
static function normaliseSpecialPage( Title $title ) {
* Returns the filename part of an url.
* Used as alternative text for external images.
*
- * @param $url string
+ * @param string $url
*
* @return string
*/
* Return the code for images which were added via external links,
* via Parser::maybeMakeExternalImage().
*
- * @param $url
- * @param $alt
+ * @param string $url
+ * @param string $alt
*
* @return string
*/
* Given parameters derived from [[Image:Foo|options...]], generate the
* HTML that that syntax inserts in the page.
*
- * @param $parser Parser object
- * @param $title Title object of the file (not the currently viewed page)
- * @param $file File object, or false if it doesn't exist
- * @param array $frameParams associative array of parameters external to the media handler.
+ * @param Parser $parser
+ * @param Title $title Title object of the file (not the currently viewed page)
+ * @param File $file File object, or false if it doesn't exist
+ * @param array $frameParams Associative array of parameters external to the media handler.
* Boolean parameters are indicated by presence or absence, the value is arbitrary and
* will often be false.
* thumbnail If present, downscale and frame
/**
* Make HTML for a thumbnail including image, border and caption
- * @param $title Title object
- * @param $file File object or false if it doesn't exist
- * @param $label String
- * @param $alt String
- * @param $align String
- * @param $params Array
- * @param $framed Boolean
- * @param $manualthumb String
- * @return mixed
+ * @param Title $title
+ * @param File|bool $file File object or false if it doesn't exist
+ * @param string $label
+ * @param string $alt
+ * @param string $align
+ * @param array $params
+ * @param bool $framed
+ * @param string $manualthumb
+ * @return string
*/
public static function makeThumbLinkObj( Title $title, $file, $label = '', $alt,
$align = 'right', $params = array(), $framed = false, $manualthumb = ""
}
/**
- * @param $title Title
- * @param $file File
+ * @param Title $title
+ * @param File $file
* @param array $frameParams
* @param array $handlerParams
* @param bool $time
* @param string $query
- * @return mixed
+ * @return string
*/
public static function makeThumbLink2( Title $title, $file, $frameParams = array(),
$handlerParams = array(), $time = false, $query = ""
*
* @param File $file
* @param MediaTransformOutput $thumb
- * @param array $hp image parameters
+ * @param array $hp Image parameters
*/
public static function processResponsiveImages( $file, $thumb, $hp ) {
global $wgResponsiveImages;
* Make a "broken" link to an image
*
* @param Title $title
- * @param string $label link label (plain text)
- * @param string $query query string
+ * @param string $label Link label (plain text)
+ * @param string $query Query string
* @param string $unused1 Unused parameter kept for b/c
* @param string $unused2 Unused parameter kept for b/c
- * @param bool $time a file of a certain timestamp was requested
+ * @param bool $time A file of a certain timestamp was requested
* @return string
*/
public static function makeBrokenImageLinkObj( $title, $label = '', $query = '', $unused1 = '', $unused2 = '', $time = false ) {
* a message key from the link text.
* Usage example: Linker::specialLink( 'Recentchanges' )
*
+ * @param string $name
+ * @param string $key
* @return string
*/
public static function specialLink( $name, $key = '' ) {
* Generate a user link if the current user is allowed to view it
* @param Revision $rev
* @param bool $isPublic Show only if all users can see it
- * @return String HTML fragment
+ * @return string HTML fragment
*/
public static function revUserLink( $rev, $isPublic = false ) {
if ( $rev->isDeleted( Revision::DELETED_USER ) && $isPublic ) {
* @param string $comment
* @param Title|null $title Title object (to generate link to the section in autocomment) or null
* @param bool $local Whether section links should refer to local page
- * @return mixed|String
+ * @return mixed|string
*/
public static function formatComment( $comment, $title = null, $local = false ) {
wfProfileIn( __METHOD__ );
/**
* Helper function for Linker::formatAutocomments
- * @param $match
+ * @param array $match
* @return string
*/
private static function formatAutocommentsCallback( $match ) {
}
/**
- * @param $match
+ * @param array $match
* @return mixed
*/
protected static function formatLinksInCommentCallback( $match ) {
}
/**
- * @param $contextTitle Title
- * @param $target
- * @param $text
+ * @param Title $contextTitle
+ * @param string $target
+ * @param string $text
* @return string
*/
public static function normalizeSubpageLink( $contextTitle, $target, &$text ) {
}
/**
- * @param $size
+ * @param int $size
* @return string
*/
public static function formatRevisionSize( $size ) {
/**
* Finish one or more sublevels on the Table of Contents
*
+ * @param int $level
* @return string
*/
public static function tocUnindent( $level ) {
/**
* parameter level defines if we are on an indentation level
*
+ * @param string $anchor
+ * @param string $tocline
+ * @param string $tocnumber
+ * @param string $level
+ * @param string|bool $sectionIndex
* @return string
*/
public static function tocLine( $anchor, $tocline, $tocnumber, $level, $sectionIndex = false ) {
* @param string $attribs Any attributes for the headline, starting with
* a space and ending with '>'
* This *must* be at least '>' for no attribs
- * @param string $anchor the anchor to give the headline (the bit after the #)
- * @param string $html html for the text of the header
+ * @param string $anchor The anchor to give the headline (the bit after the #)
+ * @param string $html Html for the text of the header
* @param string $link HTML to add for the section edit link
- * @param bool|string $legacyAnchor a second, optional anchor to give for
+ * @param bool|string $legacyAnchor A second, optional anchor to give for
* backward compatibility (false to omit)
*
* @return string HTML headline
/**
* Split a link trail, return the "inside" portion and the remainder of the trail
* as a two-element array
+ * @param string $trail
* @return array
*/
static function splitTrail( $trail ) {
*
* If the option noBrackets is set the rollback link wont be enclosed in []
*
- * @param $rev Revision object
- * @param $context IContextSource context to use or null for the main context.
- * @param $options array
+ * @param Revision $rev
+ * @param IContextSource $context Context to use or null for the main context.
+ * @param array $options
* @return string
*/
public static function generateRollback( $rev, IContextSource $context = null, $options = array( 'verify' ) ) {
* Returns null if $wgShowRollbackEditCount is disabled or false if $verify
* is set and the user is the only contributor of the page.
*
- * @param $rev Revision object
+ * @param Revision $rev
* @param bool $verify Try to verify that this revision can really be rolled back
- * @return integer|bool|null
+ * @return int|bool|null
*/
public static function getRollbackEditCount( $rev, $verify ) {
global $wgShowRollbackEditCount;
*
* @param array $hiddencats Array of hidden categories from Article::getHiddenCategories
* or similar
- * @return String HTML output
+ * @return string HTML output
*/
public static function formatHiddenCategories( $hiddencats ) {
wfProfileIn( __METHOD__ );
* unit (B, KB, MB or GB) according to the magnitude in question
*
* @param int $size Size to format
- * @return String
+ * @return string
*/
public static function formatSize( $size ) {
global $wgLang;
* element than the id, for reverse-compatibility, etc.)
*
* @param string $name Id of the element, minus prefixes.
- * @param string|null $options null or the string 'withaccess' to add an access-
+ * @param string|null $options Null or the string 'withaccess' to add an access-
* key hint
* @return string Contents of the title attribute (which you must HTML-
* escape), or false for no title attribute
*
* @param Title $nt The title object to make the link from, e.g. from Title::newFromText.
* @param string $text Link text
- * @param string $query optional query part
- * @param string $trail optional trail. Alphabetic characters at the start of this string will
+ * @param string $query Optional query part
+ * @param string $trail Optional trail. Alphabetic characters at the start of this string will
* be included in the link text. Other characters will be appended after
* the end of the link.
- * @param string $prefix optional prefix. As trail, only before instead of after.
+ * @param string $prefix Optional prefix. As trail, only before instead of after.
* @return string
*/
static function makeLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
/**
* Returns the attributes for the tooltip and access key.
+ * @param string $name
* @return array
*/
public static function tooltipAndAccesskeyAttribs( $name ) {
/**
* Returns raw bits of HTML, use titleAttrib()
+ * @param string $name
+ * @param array|null $options
* @return null|string
*/
public static function tooltip( $name, $options = null ) {
/**
* Factory: creates an object representing an ID
*
- * @param $id
+ * @param int $id
*
* @return MagicWord
*/
/**
* Allow external reads of TTL array
*
- * @param $id int
+ * @param int $id
* @return array
*/
static function getCacheTTL( $id ) {
/**
* Initialises this object with an ID
*
- * @param $id
+ * @param int $id
* @throws MWException
*/
function load( $id ) {
* first string is longer, the same length or shorter than the second
* string.
*
- * @param $s1 string
- * @param $s2 string
+ * @param string $s1
+ * @param string $s2
*
* @return int
*/
/**
* Returns true if the text contains the word
*
- * @param $text string
+ * @param string $text
*
* @return bool
*/
/**
* Returns true if the text starts with the word
*
- * @param $text string
+ * @param string $text
*
* @return bool
*/
/**
* Returns true if the text matched the word
*
- * @param $text string
+ * @param string $text
*
* @return bool
* @since 1.23
* part in the regex and the matched variable part ($1) if there
* is one.
*
- * @param $text string
+ * @param string $text
*
* @return string
*/
* Returns true if the text matches the word, and alters the
* input string, removing all instances of the word
*
- * @param $text string
+ * @param string $text
*
* @return bool
*/
}
/**
- * @param $text
+ * @param string $text
* @return bool
*/
function matchStartAndRemove( &$text ) {
/**
* Replaces the word with something else
*
- * @param $replacement
- * @param $subject
- * @param $limit int
+ * @param string $replacement
+ * @param string $subject
+ * @param int $limit
*
* @return string
*/
* Calls back a function to determine what to replace xxx with
* Input word must contain $1
*
- * @param $text string
- * @param $callback
+ * @param string $text
+ * @param callable $callback
*
* @return string
*/
/**
* Accesses the synonym list directly
*
- * @param $i int
+ * @param int $i
*
* @return string
*/
* $result. The return value is true if something was replaced.
* @todo Should this be static? It doesn't seem to be used at all
*
- * @param $magicarr
- * @param $subject
- * @param $result
+ * @param array $magicarr
+ * @param string $subject
+ * @param string $result
*
* @return bool
*/
* Adds all the synonyms of this MagicWord to an array, to allow quick
* lookup in a list of magic words
*
- * @param $array
- * @param $value
+ * @param array $array
+ * @param string $value
*/
function addToArray( &$array, $value ) {
global $wgContLang;
var $matches;
/**
- * @param $names array
+ * @param array $names
*/
function __construct( $names = array() ) {
$this->names = $names;
/**
* Add a magic word by name
*
- * @param $name string
+ * @param string $name
*/
public function add( $name ) {
$this->names[] = $name;
/**
* Add a number of magic words by name
*
- * @param $names array
+ * @param array $names
*/
public function addArray( $names ) {
$this->names = array_merge( $this->names, array_values( $names ) );
* Returns array(magic word ID, parameter value)
* If there is no parameter value, that element will be false.
*
- * @param $m array
+ * @param array $m
*
* @throws MWException
* @return array
* parameter in the second element.
* Both elements are false if there was no match.
*
- * @param $text string
+ * @param string $text
*
* @return array
*/
* Match some text, without parameter capture
* Returns the magic word name, or false if there was no capture
*
- * @param $text string
+ * @param string $text
*
* @return string|bool False on failure
*/
* Returns an associative array, ID => param value, for all items that match
* Removes the matched items from the input string (passed by reference)
*
- * @param $text string
+ * @param string $text
*
* @return array
*/
* Return false if no match found and $text is not modified.
* Does not match parameters.
*
- * @param $text string
+ * @param string $text
*
* @return int|bool False on failure
*/
*
* @since 1.22
*
- * @param number|number[] [$param,...] Time period parameters, or a single argument that is
+ * @param int|int[] [$param,...] Time period parameters, or a single argument that is
* an array of time period parameters.
*
* @return Message $this
*
* @since 1.19
*
- * @param $context IContextSource
+ * @param IContextSource $context
*
* @return Message $this
*/
*
* @since 1.18
*
- * @param $title Title object
+ * @param Title $title
*
* @return Message $this
*/
* @param string $message The message text.
* @param string $type Either "before" or "after".
*
- * @return String
+ * @return string
*/
protected function replaceParameters( $message, $type = 'before' ) {
$replacementKeys = array();
/**
* Set the offset from an other source than the request
*
- * @param $offset Int|String
+ * @param int|string $offset
*/
function setOffset( $offset ) {
$this->mOffset = $offset;
*
* Verifies limit is between 1 and 5000
*
- * @param $limit Int|String
+ * @param int|string $limit
*/
function setLimit( $limit ) {
$limit = (int)$limit;
* in the result or not. By default this is not the case, but when the
* offset is user-supplied this might be wanted.
*
- * @param $include bool
+ * @param bool $include
*/
public function setIncludeOffset( $include ) {
$this->mIncludeOffset = $include;
* Extract some useful data from the result object for use by
* the navigation bar, put it into $this
*
- * @param $isFirst bool: False if there are rows before those fetched (i.e.
+ * @param bool $isFirst False if there are rows before those fetched (i.e.
* if a "previous" link would make sense)
- * @param $limit Integer: exact query limit
- * @param $res ResultWrapper
+ * @param int $limit Exact query limit
+ * @param ResultWrapper $res
*/
function extractResultInfo( $isFirst, $limit, ResultWrapper $res ) {
$numRows = $res->numRows();
/**
* Get some text to go in brackets in the "function name" part of the SQL comment
*
- * @return String
+ * @return string
*/
function getSqlComment() {
return get_class( $this );
* Do a query with specified parameters, rather than using the object
* context
*
- * @param string $offset index offset, inclusive
- * @param $limit Integer: exact query limit
- * @param $descending Boolean: query direction, false for ascending, true for descending
+ * @param string $offset Index offset, inclusive
+ * @param int $limit Exact query limit
+ * @param bool $descending Query direction, false for ascending, true for descending
* @return ResultWrapper
*/
public function reallyDoQuery( $offset, $limit, $descending ) {
/**
* Build variables to use by the database wrapper.
*
- * @param string $offset index offset, inclusive
- * @param $limit Integer: exact query limit
- * @param $descending Boolean: query direction, false for ascending, true for descending
+ * @param string $offset Index offset, inclusive
+ * @param int $limit Exact query limit
+ * @param bool $descending Query direction, false for ascending, true for descending
* @return array
*/
protected function buildQueryInfo( $offset, $limit, $descending ) {
/**
* Pre-process results; useful for performing batch existence checks, etc.
*
- * @param $result ResultWrapper
+ * @param ResultWrapper $result
*/
protected function preprocessResults( $result ) {}
* Get the formatted result list. Calls getStartBody(), formatRow() and
* getEndBody(), concatenates the results and returns them.
*
- * @return String
+ * @return string
*/
public function getBody() {
if ( !$this->mQueryDone ) {
/**
* Make a self-link
*
- * @param string $text text displayed on the link
- * @param array $query associative array of parameter to be in the query string
- * @param string $type value of the "rel" attribute
+ * @param string $text Text displayed on the link
+ * @param array $query Associative array of parameter to be in the query string
+ * @param string $type Value of the "rel" attribute
*
- * @return String: HTML fragment
+ * @return string HTML fragment
*/
function makeLink( $text, array $query = null, $type = null ) {
if ( $query === null ) {
* Hook into getBody(), allows text to be inserted at the start. This
* will be called even if there are no rows in the result set.
*
- * @return String
+ * @return string
*/
protected function getStartBody() {
return '';
/**
* Hook into getBody() for the end of the list
*
- * @return String
+ * @return string
*/
protected function getEndBody() {
return '';
* Hook into getBody(), for the bit between the start and the
* end when there are no rows
*
- * @return String
+ * @return string
*/
protected function getEmptyBody() {
return '';
/**
* Get the number of rows in the result set
*
- * @return Integer
+ * @return int
*/
function getNumRows() {
if ( !$this->mQueryDone ) {
/**
* Get a URL query array for the prev, next, first and last links.
*
- * @return Array
+ * @return array
*/
function getPagingQueries() {
if ( !$this->mQueryDone ) {
/**
* Returns whether to show the "navigation bar"
*
- * @return Boolean
+ * @return bool
*/
function isNavigationBarShown() {
if ( !$this->mQueryDone ) {
* $linkTexts will be used. Both $linkTexts and $disabledTexts are arrays
* of HTML.
*
- * @param $linkTexts Array
- * @param $disabledTexts Array
- * @return Array
+ * @param array $linkTexts
+ * @param array $disabledTexts
+ * @return array
*/
function getPagingLinks( $linkTexts, $disabledTexts = array() ) {
$queries = $this->getPagingQueries();
* options => option array
* join_conds => JOIN conditions
*
- * @return Array
+ * @return array
*/
abstract function getQueryInfo();
* Needless to say, it's really not a good idea to use a non-unique index
* for this! That won't page right.
*
- * @return string|Array
+ * @return string|array
*/
abstract function getIndexField();
* page_len,page_id avoids temp tables (given a page_len index). This would
* also work if page_id was non-unique but we had a page_len,page_id index.
*
- * @return Array
+ * @return array
*/
protected function getExtraSortFields() {
return array();
* particular instantiation, which is a single value. This is the set of
* all defaults for the class.
*
- * @return Boolean
+ * @return bool
*/
protected function getDefaultDirections() {
return false;
* Shamelessly stolen bits from ReverseChronologicalPager,
* didn't want to do class magic as may be still revamped
*
- * @return String HTML
+ * @return string HTML
*/
function getNavigationBar() {
if ( !$this->isNavigationBarShown() ) {
* array whose keys must exactly match the keys of the array returned
* by getIndexField(), and whose values are message keys.
*
- * @return Array
+ * @return array
*/
protected function getOrderTypeMessages() {
return null;
/**
* @protected
* @param stdClass $row
- * @return String HTML
+ * @return string HTML
*/
function formatRow( $row ) {
$this->mCurrentRow = $row; // In case formatValue etc need to know
*
* @protected
*
- * @param $row Object: the database result row
- * @return String
+ * @param object $row The database result row
+ * @return string
*/
function getRowClass( $row ) {
return '';
*
* @protected
*
- * @param $row Object: the database result row
- * @return Array of attribute => value
+ * @param object $row The database result row
+ * @return array Array of attribute => value
*/
function getRowAttrs( $row ) {
$class = $this->getRowClass( $row );
*
* @param string $field The column
* @param string $value The cell contents
- * @return Array of attr => value
+ * @return array Array of attr => value
*/
function getCellAttrs( $field, $value ) {
return array( 'class' => 'TablePager_col_' . $field );
/**
* A navigation bar with images
- * @return String HTML
+ * @return string HTML
*/
public function getNavigationBar() {
global $wgStylePath;
/**
* Get a "<select>" element which has options for each of the allowed limits
*
- * @param $attribs String: Extra attributes to set
- * @return String: HTML fragment
+ * @param string $attribs Extra attributes to set
+ * @return string HTML fragment
*/
public function getLimitSelect( $attribs = array() ) {
$select = new XmlSelect( 'limit', false, $this->mLimit );
* Resubmits all defined elements of the query string, except for a
* blacklist, passed in the $blacklist parameter.
*
- * @param array $blacklist parameters from the request query which should not be resubmitted
- * @return String: HTML fragment
+ * @param array $blacklist Parameters from the request query which should not be resubmitted
+ * @return string HTML fragment
*/
function getHiddenFields( $blacklist = array() ) {
$blacklist = (array)$blacklist;
/**
* Get a form containing a limit selection dropdown
*
- * @return String: HTML fragment
+ * @return string HTML fragment
*/
function getLimitForm() {
global $wgScript;
* Return true if the named field should be sortable by the UI, false
* otherwise
*
- * @param $field String
+ * @param string $field
*/
abstract function isFieldSortable( $field );
*
* @protected
*
- * @param string $name the database field name
- * @param string $value the value retrieved from the database
+ * @param string $name The database field name
+ * @param string $value The value retrieved from the database
*/
abstract function formatValue( $name, $value );
* field name, for use in the table header. The description should be plain
* text, it will be HTML-escaped later.
*
- * @return Array
+ * @return array
*/
abstract function getFieldNames();
}
* This is in a separate method so that add() can handle the difference between
* a single string $path and an array() $path that contains multiple path
* patterns each with an associated $key to pass on.
- * @param $path string
- * @param $params array
- * @param $options array
- * @param $key null|string
+ * @param string $path
+ * @param array $params
+ * @param array $options
+ * @param null|string $key
*/
protected function doAdd( $path, $params, $options, $key = null ) {
// Make sure all paths start with a /
/**
* Add a new path pattern to the path router with the strict option on
* @see self::add
- * @param $path string|array
- * @param $params array
- * @param $options array
+ * @param string|array $path
+ * @param array $params
+ * @param array $options
*/
public function addStrict( $path, $params = array(), $options = array() ) {
$options['strict'] = true;
}
/**
- * @param $pattern object
+ * @param object $pattern
* @return float|int
*/
protected static function makeWeight( $pattern ) {
* Parse a path and return the query matches for the path
*
* @param string $path The path to parse
- * @return Array The array of matches for the path
+ * @return array The array of matches for the path
*/
public function parse( $path ) {
// Make sure our patterns are sorted by weight so the most specific
}
/**
- * @param $path string
- * @param $pattern string
+ * @param string $path
+ * @param string $pattern
* @return array|null
*/
protected static function extractTitle( $path, $pattern ) {
* We do this inside of a replacement callback because after replacement we can't tell the
* difference between a $1 that was not replaced and a $1 that was part of
* the content a $1 was replaced with.
- * @param $value string
+ * @param string $value
* @return string
*/
public function replace( $value ) {
}
/**
- * @param $m array
+ * @param array $m
* @return string
*/
protected function callback( $m ) {
* Do a prefix search of titles and return a list of matching page names.
* @deprecated: Since 1.23, use TitlePrefixSearch or StringPrefixSearch classes
*
- * @param $search String
- * @param $limit Integer
- * @param array $namespaces used if query is not explicitly prefixed
- * @return Array of strings
+ * @param string $search
+ * @param int $limit
+ * @param array $namespaces Used if query is not explicitly prefixed
+ * @return array Array of strings
*/
public static function titleSearch( $search, $limit, $namespaces = array() ) {
$prefixSearch = new StringPrefixSearch;
/**
* Do a prefix search of titles and return a list of matching page names.
*
- * @param $search String
- * @param $limit Integer
- * @param array $namespaces used if query is not explicitly prefixed
- * @return Array of strings or Title objects
+ * @param string $search
+ * @param int $limit
+ * @param array $namespaces Used if query is not explicitly prefixed
+ * @return array Array of strings or Title objects
*/
public function search( $search, $limit, $namespaces = array() ) {
$search = trim( $search );
/**
* Do a prefix search for all possible variants of the prefix
- * @param $search String
- * @param $limit Integer
+ * @param string $search
+ * @param int $limit
* @param array $namespaces
*
* @return array
/**
* Do a prefix search of titles and return a list of matching page names.
- * @param $namespaces Array
- * @param $search String
- * @param $limit Integer
- * @return Array of strings
+ * @param array $namespaces
+ * @param string $search
+ * @param int $limit
+ * @return array Array of strings
*/
protected function searchBackend( $namespaces, $search, $limit ) {
if ( count( $namespaces ) == 1 ) {
/**
* Prefix search special-case for Special: namespace.
*
- * @param string $search term
- * @param $limit Integer: max number of items to return
- * @return Array
+ * @param string $search Term
+ * @param int $limit Max number of items to return
+ * @return array
*/
protected function specialSearch( $search, $limit ) {
global $wgContLang;
* be automatically capitalized by Title::secureAndSpit()
* later on depending on $wgCapitalLinks)
*
- * @param array $namespaces namespaces to search in
- * @param string $search term
- * @param $limit Integer: max number of items to return
- * @return Array of Title objects
+ * @param array $namespaces Namespaces to search in
+ * @param string $search Term
+ * @param int $limit Max number of items to return
+ * @return array Array of Title objects
*/
protected function defaultSearchBackend( $namespaces, $search, $limit ) {
$ns = array_shift( $namespaces ); // support only one namespace
/**
* Validate an array of numerical namespace indexes
*
- * @param $namespaces Array
- * @return Array (default: contains only NS_MAIN)
+ * @param array $namespaces
+ * @return array (default: contains only NS_MAIN)
*/
protected function validateNamespaces( $namespaces ) {
global $wgContLang;
* @param string $suffix The suffix of the wiki in question.
* @param array $params List of parameters. $.'key' is replaced by $value in all returned data.
* @param array $wikiTags The tags assigned to the wiki.
- * @return Mixed the value of the setting requested.
+ * @return mixed The value of the setting requested.
*/
public function get( $settingName, $wiki, $suffix = null, $params = array(), $wikiTags = array() ) {
$params = $this->mergeParams( $wiki, $suffix, $params, $wikiTags );
*
* @param string $settingName ID of the setting name to retrieve.
* @param string $wiki Wiki ID of the wiki in question.
- * @param array $params array of parameters.
- * @return Mixed the value of the setting requested.
+ * @param array $params Array of parameters.
+ * @return mixed The value of the setting requested.
*/
protected function getSetting( $settingName, $wiki, /*array*/ $params ) {
$retval = null;
* Type-safe string replace; won't do replacements on non-strings
* private?
*
- * @param $from
- * @param $to
- * @param $in
+ * @param string $from
+ * @param string $to
+ * @param string|array $in
* @return string
*/
function doReplace( $from, $to, $in ) {
* @param string $suffix The suffix of the wiki in question.
* @param array $params List of parameters. $.'key' is replaced by $value in all returned data.
* @param array $wikiTags The tags assigned to the wiki.
- * @return Array Array of settings requested.
+ * @return array Array of settings requested.
*/
public function getAll( $wiki, $suffix = null, $params = array(), $wikiTags = array() ) {
$params = $this->mergeParams( $wiki, $suffix, $params, $wikiTags );
}
/**
- * @param $setting string
- * @param $wiki string
- * @param $params array
+ * @param string $setting
+ * @param string $wiki
+ * @param array $params
*/
public function extractGlobalSetting( $setting, $wiki, $params ) {
$value = $this->getSetting( $setting, $wiki, $params );
* See the documentation of self::$siteParamsCallback for more in-depth
* documentation about this function
*
- * @param $wiki String
+ * @param string $wiki
* @return array
*/
protected function getWikiParams( $wiki ) {
* @param string $wiki Wiki ID of the wiki in question.
* @param string $suffix The suffix of the wiki in question.
* @param array $params List of parameters. $.'key' is replaced by $value in
- * all returned data.
+ * all returned data.
* @param array $wikiTags The tags assigned to the wiki.
* @return array
*/
/**
* Work out the site and language name from a database name
- * @param $db
+ * @param string $db
*
* @return array
*/
*
* @param string $wiki
* @param array|string $settings A setting name or array of setting names
- * @return Array|mixed Array if $settings is an array, otherwise the value
+ * @return array|mixed Array if $settings is an array, otherwise the value
* @throws MWException
* @since 1.21
*/
/**
* Returns true if the given vhost is handled locally.
- * @param $vhost String
+ * @param string $vhost
* @return bool
*/
public function isLocalVHost( $vhost ) {
* PHP's array_merge_recursive() merges ANY duplicate values into arrays,
* which is not fun
*
- * @param $array1 array
+ * @param array $array1
*
* @return array
*/
}
/**
- * @param $recache bool
+ * @param bool $recache
*/
static function load( $recache = false ) {
if ( self::$loaded && !$recache ) {
}
/**
- * @return Bool|ResultWrapper
+ * @return bool|ResultWrapper
*/
static function loadAndLazyInit() {
wfDebug( __METHOD__ . ": reading site_stats from slave\n" );
}
/**
- * @param $db DatabaseBase
- * @return Bool|ResultWrapper
+ * @param DatabaseBase $db
+ * @return bool|ResultWrapper
*/
static function doLoad( $db ) {
return $db->selectRow( 'site_stats', array(
/**
* Find the number of users in a given user group.
* @param string $group name of group
- * @return Integer
+ * @return int
*/
static function numberingroup( $group ) {
if ( !isset( self::$groupMemberCounts[$group] ) ) {
}
/**
- * @param $ns int
+ * @param int $ns
*
* @return int
*/
*
* Checks only fields which are filled by SiteStatsInit::refresh.
*
- * @param $row
+ * @param bool|object $row
*
* @return bool
*/
/**
* Constructor
- * @param $database Boolean or DatabaseBase:
+ * @param bool|DatabaseBase $database
* - Boolean: whether to use the master DB
* - DatabaseBase: database connection to use
*/
/**
* Count the total number of edits
- * @return Integer
+ * @return int
*/
public function edits() {
$this->mEdits = $this->db->selectField( 'revision', 'COUNT(*)', '', __METHOD__ );
/**
* Count pages in article space(s)
- * @return Integer
+ * @return int
*/
public function articles() {
global $wgArticleCountMethod;
/**
* Count total pages
- * @return Integer
+ * @return int
*/
public function pages() {
$this->mPages = $this->db->selectField( 'page', 'COUNT(*)', '', __METHOD__ );
/**
* Count total users
- * @return Integer
+ * @return int
*/
public function users() {
$this->mUsers = $this->db->selectField( 'user', 'COUNT(*)', '', __METHOD__ );
/**
* Count views
- * @return Integer
+ * @return int
*/
public function views() {
$this->mViews = $this->db->selectField( 'page', 'SUM(page_counter)', '', __METHOD__ );
/**
* Count total files
- * @return Integer
+ * @return int
*/
public function files() {
$this->mFiles = $this->db->selectField( 'image', 'COUNT(*)', '', __METHOD__ );
* Do all updates and commit them. More or less a replacement
* for the original initStats, but without output.
*
- * @param $database DatabaseBase|bool
+ * @param DatabaseBase|bool $database
* - Boolean: whether to use the master DB
* - DatabaseBase: database connection to use
* @param array $options of options, may contain the following values
/**
* Add specific styles for this skin
*
- * @param $out OutputPage
+ * @param OutputPage $out
*/
function setupSkinUserCss( OutputPage $out ) {
$out->addModuleStyles( array(
* and eventually it spits out some HTML. Should have interface
* roughly equivalent to PHPTAL 0.7.
*
- * @param $classname String
- * @param string $repository subdirectory where we keep template files
- * @param $cache_dir string
+ * @param string $classname
+ * @param string $repository Subdirectory where we keep template files
+ * @param string $cache_dir
* @return QuickTemplate
* @private
*/
/**
* initialize various variables and generate the template
*
- * @param $out OutputPage
+ * @param OutputPage $out
*/
function outputPage( OutputPage $out = null ) {
wfProfileIn( __METHOD__ );
* initialize various variables and generate the template
*
* @since 1.23
- * @return QuickTemplate the template to be executed by outputPage
+ * @return QuickTemplate The template to be executed by outputPage
*/
protected function prepareQuickTemplate() {
global $wgContLang, $wgScript, $wgStylePath,
* an error object of the appropriate type.
* For the base class, assume strings all around.
*
- * @param $str Mixed
+ * @param string $str
* @private
*/
function printOrError( $str ) {
/**
* Builds an array with tab definition
*
- * @param Title $title page where the tab links to
- * @param string|array $message message key or an array of message keys (will fall back)
- * @param boolean $selected display the tab as selected
- * @param string $query query string attached to tab URL
- * @param boolean $checkEdit check if $title exists and mark with .new if one doesn't
+ * @param Title $title page Where the tab links to
+ * @param string|array $message Message key or an array of message keys (will fall back)
+ * @param bool $selected Display the tab as selected
+ * @param string $query Query string attached to tab URL
+ * @param bool $checkEdit Check if $title exists and mark with .new if one doesn't
*
* @return array
*/
/**
* Sets the value $value to $name
- * @param $name
- * @param $value
+ * @param string $name
+ * @param mixed $value
*/
public function set( $name, $value ) {
$this->data[$name] = $value;
}
/**
- * @param $name
- * @param $value
+ * @param string $name
+ * @param mixed $value
*/
public function setRef( $name, &$value ) {
$this->data[$name] =& $value;
}
/**
- * @param $t
+ * @param MediaWiki_I18N $t
*/
public function setTranslator( &$t ) {
$this->translator = &$t;
/**
* @private
+ * @param string $str
+ * @return string
*/
function text( $str ) {
echo htmlspecialchars( $this->data[$str] );
/**
* @private
+ * @param string $str
+ * @return string
*/
function html( $str ) {
echo $this->data[$str];
/**
* @private
+ * @param string $str
+ * @return string
*/
function msg( $str ) {
echo htmlspecialchars( $this->translator->translate( $str ) );
/**
* @private
+ * @param string $str
+ * @return string
*/
function msgHtml( $str ) {
echo $this->translator->translate( $str );
/**
* An ugly, ugly hack.
* @private
+ * @param string $str
+ * @return string
*/
function msgWiki( $str ) {
global $wgOut;
/**
* @private
+ * @param string $str
* @return bool
*/
function haveData( $str ) {
/**
* @private
*
+ * @param string $str
* @return bool
*/
function haveMsg( $str ) {
/**
* Get the Skin object related to this object
*
- * @return Skin object
+ * @return Skin
*/
public function getSkin() {
return $this->data['skin'];
* Fetch the output of a QuickTemplate and return it
*
* @since 1.23
- * @return String
+ * @return string
*/
public function getHTML() {
ob_start();
/**
* Get a Message object with its context set
*
- * @param string $name message name
+ * @param string $name Message name
* @return Message
*/
public function getMsg( $name ) {
/**
* Generates a list item for a navigation, portlet, portal, sidebar... list
*
- * @param $key string, usually a key from the list you are generating this link from.
- * @param $item array, of list item data containing some of a specific set of keys.
+ * @param string $key Usually a key from the list you are generating this link from.
+ * @param array $item Array of list item data containing some of a specific set of keys.
* The "id", "class" and "itemtitle" keys will be used as attributes for the list item,
* if "active" contains a value of true a "active" class will also be appended to class.
*
- * @param $options array
+ * @param array $options
*
* If you want something other than a "<li>" you can pass a tag name such as
* "tag" => "span" in the $options array to change the tag used.
* in the list of footer icons. This is mostly useful for skins which only
* display the text from footericons instead of the images and don't want a
* duplicate copyright statement because footerlinks already rendered one.
- * @return
+ * @return string
*/
function getFooterIcons( $option = null ) {
// Generate additional footer icons
/**
* Factory function for good results
*
- * @param $value Mixed
+ * @param mixed $value
* @return Status
*/
static function newGood( $value = null ) {
* Returns whether the operation completed and didn't have any error or
* warnings
*
- * @return Boolean
+ * @return bool
*/
public function isGood() {
return $this->ok && !$this->errors;
/**
* Returns whether the operation completed
*
- * @return Boolean
+ * @return bool
*/
public function isOK() {
return $this->ok;
/**
* Add a new warning
*
- * @param string|Message $message message name or object
+ * @param string|Message $message Message name or object
*/
public function warning( $message /*, parameters... */ ) {
$params = array_slice( func_get_args(), 1 );
* Add an error, do not set fatal flag
* This can be used for non-fatal errors
*
- * @param string|Message $message message name or object
+ * @param string|Message $message Message name or object
*/
public function error( $message /*, parameters... */ ) {
$params = array_slice( func_get_args(), 1 );
* Add an error and set OK to false, indicating that the operation
* as a whole was fatal
*
- * @param string|Message $message message name or object
+ * @param string|Message $message Message name or object
*/
public function fatal( $message /*, parameters... */ ) {
$params = array_slice( func_get_args(), 1 );
}
/**
- * @param $params array
+ * @param array $params
* @return array
*/
protected function cleanParams( $params ) {
/**
* Get the error list as a wikitext formatted list
*
- * @param string $shortContext a short enclosing context message name, to
+ * @param string $shortContext A short enclosing context message name, to
* be used when there is a single error
- * @param string $longContext a long enclosing context message name, for a list
- * @return String
+ * @param string $longContext A long enclosing context message name, for a list
+ * @return string
*/
public function getWikiText( $shortContext = false, $longContext = false ) {
if ( count( $this->errors ) == 0 ) {
/**
* Return the message for a single error.
- * @param $error Mixed With an array & two values keyed by
+ * @param mixed $error With an array & two values keyed by
* 'message' and 'params', use those keys-value pairs.
* Otherwise, if its an array, just use the first value as the
* message and the remaining items as the params.
*
- * @return String
+ * @return string
*/
protected function getErrorMessage( $error ) {
if ( is_array( $error ) ) {
/**
* Get the error message as HTML. This is done by parsing the wikitext error
* message.
- * @param string $shortContext a short enclosing context message name, to
+ * @param string $shortContext A short enclosing context message name, to
* be used when there is a single error
- * @param string $longContext a long enclosing context message name, for a list
- * @return String
+ * @param string $longContext A long enclosing context message name, for a list
+ * @return string
*/
public function getHTML( $shortContext = false, $longContext = false ) {
$text = $this->getWikiText( $shortContext, $longContext );
/**
* Return an array with the wikitext for each item in the array.
- * @param $errors Array
- * @return Array
+ * @param array $errors
+ * @return array
*/
protected function getErrorMessageArray( $errors ) {
return array_map( array( $this, 'getErrorMessage' ), $errors );
/**
* Returns a list of status messages of the given type
- * @param $type String
- * @return Array
+ * @param string $type
+ * @return array
*/
protected function getStatusArray( $type ) {
$result = array();
* Returns a list of status messages of the given type, with message and
* params left untouched, like a sane version of getStatusArray
*
- * @param $type String
+ * @param string $type
*
- * @return Array
+ * @return array
*/
public function getErrorsByType( $type ) {
$result = array();
* Note, due to the lack of tools for comparing Message objects, this
* function will not work when using a Message object as a parameter.
*
- * @param string $msg message name
- * @return Boolean
+ * @param string $msg Message name
+ * @return bool
*/
public function hasMessage( $msg ) {
foreach ( $this->errors as $error ) {
*/
class MailAddress {
/**
- * @param string|User $address string with an email address, or a User object
- * @param string $name human-readable name if a string address is given
- * @param string $realName human-readable real name if a string address is given
+ * @param string|User $address String with an email address, or a User object
+ * @param string $name Human-readable name if a string address is given
+ * @param string $realName Human-readable real name if a string address is given
*/
function __construct( $address, $name = null, $realName = null ) {
if ( is_object( $address ) && $address instanceof User ) {
/**
* Send mail using a PEAR mailer
*
- * @param $mailer
- * @param $dest
- * @param $headers
- * @param $body
+ * @param UserMailer $mailer
+ * @param string $dest
+ * @param string $headers
+ * @param string $body
*
* @return Status
*/
* Note RFC2822 says newlines must be CRLF (\r\n)
* but php mail naively "corrects" it and requires \n for the "correction" to work
*
- * @return String
+ * @return string
*/
static function arrayToHeaderString( $headers, $endl = "\n" ) {
$strings = array();
/**
* Create a value suitable for the MessageId Header
*
- * @return String
+ * @return string
*/
static function makeMsgId() {
global $wgSMTP, $wgServer;
* array of parameters. It requires PEAR:Mail to do that.
* Otherwise it just uses the standard PHP 'mail' function.
*
- * @param $to MailAddress: recipient's email (or an array of them)
- * @param $from MailAddress: sender's email
- * @param string $subject email's subject.
- * @param string $body email's text or Array of two strings to be the text and html bodies
- * @param $replyto MailAddress: optional reply-to email (default: null).
- * @param string $contentType optional custom Content-Type (default: text/plain; charset=UTF-8)
+ * @param MailAddress $to Recipient's email (or an array of them)
+ * @param MailAddress $from Sender's email
+ * @param string $subject Email's subject.
+ * @param string $body Email's text or Array of two strings to be the text and html bodies
+ * @param MailAddress $replyto Optional reply-to email (default: null).
+ * @param string $contentType Optional custom Content-Type (default: text/plain; charset=UTF-8)
* @throws MWException
- * @return Status object
+ * @return Status
*/
public static function send( $to, $from, $subject, $body, $replyto = null, $contentType = 'text/plain; charset=UTF-8' ) {
global $wgSMTP, $wgEnotifMaxRecips, $wgAdditionalMailParams, $wgAllowHTMLEmail;
/**
* Set the mail error message in self::$mErrorString
*
- * @param $code Integer: error number
- * @param string $string error message
+ * @param int $code Error number
+ * @param string $string Error message
*/
static function errorHandler( $code, $string ) {
self::$mErrorString = preg_replace( '/^mail\(\)(\s*\[.*?\])?: /', '', $string );
/**
* Converts a string into a valid RFC 822 "phrase", such as is used for the sender name
- * @param $phrase string
+ * @param string $phrase
* @return string
*/
public static function rfc822Phrase( $phrase ) {
*
* May be deferred via the job queue.
*
- * @param $editor User object
- * @param $title Title object
- * @param $timestamp
- * @param $summary
- * @param $minorEdit
- * @param $oldid (default: false)
- * @param $pageStatus (default: 'changed')
+ * @param User $editor
+ * @param Title $title
+ * @param string $timestamp
+ * @param string $summary
+ * @param bool $minorEdit
+ * @param bool $oldid (default: false)
+ * @param string $pageStatus (default: 'changed')
*/
public function notifyOnPageChange( $editor, $title, $timestamp, $summary, $minorEdit, $oldid = false, $pageStatus = 'changed' ) {
global $wgEnotifUseJobQ, $wgEnotifWatchlist, $wgShowUpdatedMarker, $wgEnotifMinorEdits,
* Send emails corresponding to the user $editor editing the page $title.
* Also updates wl_notificationtimestamp.
*
- * @param $editor User object
- * @param $title Title object
+ * @param User $editor
+ * @param Title $title
* @param string $timestamp Edit timestamp
* @param string $summary Edit summary
- * @param $minorEdit bool
+ * @param bool $minorEdit
* @param int $oldid Revision ID
- * @param array $watchers of user IDs
+ * @param array $watchers Array of user IDs
* @param string $pageStatus
* @throws MWException
*/
}
/**
- * @param $editor User
- * @param $title Title bool
- * @param $minorEdit
+ * @param User $editor
+ * @param Title $title
+ * @param bool $minorEdit
* @return bool
*/
private function canSendUserTalkEmail( $editor, $title, $minorEdit ) {
* depending on settings.
*
* Call sendMails() to send any mails that were queued.
- * @param $user User
+ * @param User $user
*/
function compose( $user ) {
global $wgEnotifImpersonal;
* timestamp in proper timezone, etc) and sends it out.
* Returns true if the mail was sent successfully.
*
- * @param $watchingUser User object
- * @return Boolean
+ * @param User $watchingUser
+ * @return bool
* @private
*/
function sendPersonalised( $watchingUser ) {
/**
* Same as sendPersonalised but does impersonal mail suitable for bulk
* mailing. Takes an array of MailAddress objects.
- * @param $addresses array
+ * @param array $addresses
* @return Status|null
*/
function sendImpersonal( $addresses ) {
*
* @see newFromId()
* @see newFromName()
- * @param $db DatabaseBase: db connection
- * @param string $database database name
- * @param string $name user name
- * @param $id Integer: user ID
+ * @param DatabaseBase $db Db connection
+ * @param string $database Database name
+ * @param string $name User name
+ * @param int $id User ID
*/
private function __construct( $db, $database, $name, $id ) {
$this->db = $db;
/**
* Accessor for $this->database
*
- * @return String: database name
+ * @return string Database name
*/
public function getDBName() {
return $this->database;
/**
* Confirm the selected database name is a valid local interwiki database name.
*
- * @param string $database database name
- * @return Boolean
+ * @param string $database Database name
+ * @return bool
*/
public static function validDatabase( $database ) {
global $wgLocalDatabases;
/**
* Same as User::whoIs()
*
- * @param string $database database name
- * @param $id Integer: user ID
- * @param $ignoreInvalidDB Boolean: if true, don't check if $database is in $wgLocalDatabases
- * @return String: user name or false if the user doesn't exist
+ * @param string $database Database name
+ * @param int $id User ID
+ * @param bool $ignoreInvalidDB If true, don't check if $database is in $wgLocalDatabases
+ * @return string User name or false if the user doesn't exist
*/
public static function whoIs( $database, $id, $ignoreInvalidDB = false ) {
$user = self::newFromId( $database, $id, $ignoreInvalidDB );
/**
* Factory function; get a remote user entry by ID number.
*
- * @param string $database database name
- * @param $id Integer: user ID
- * @param $ignoreInvalidDB Boolean: if true, don't check if $database is in $wgLocalDatabases
- * @return UserRightsProxy or null if doesn't exist
+ * @param string $database Database name
+ * @param int $id User ID
+ * @param bool $ignoreInvalidDB If true, don't check if $database is in $wgLocalDatabases
+ * @return UserRightsProxy|null If doesn't exist
*/
public static function newFromId( $database, $id, $ignoreInvalidDB = false ) {
return self::newFromLookup( $database, 'user_id', intval( $id ), $ignoreInvalidDB );
/**
* Factory function; get a remote user entry by name.
*
- * @param string $database database name
- * @param string $name user name
- * @param $ignoreInvalidDB Boolean: if true, don't check if $database is in $wgLocalDatabases
- * @return UserRightsProxy or null if doesn't exist
+ * @param string $database Database name
+ * @param string $name User name
+ * @param bool $ignoreInvalidDB If true, don't check if $database is in $wgLocalDatabases
+ * @return UserRightsProxy|null If doesn't exist
*/
public static function newFromName( $database, $name, $ignoreInvalidDB = false ) {
return self::newFromLookup( $database, 'user_name', $name, $ignoreInvalidDB );
}
/**
- * @param $database
- * @param $field
- * @param $value
- * @param $ignoreInvalidDB bool
+ * @param string $database
+ * @param string $field
+ * @param string $value
+ * @param bool $ignoreInvalidDB
* @return null|UserRightsProxy
*/
private static function newFromLookup( $database, $field, $value, $ignoreInvalidDB = false ) {
* Open a database connection to work on for the requested user.
* This may be a new connection to another database for remote users.
*
- * @param $database String
- * @param $ignoreInvalidDB Boolean: if true, don't check if $database is in $wgLocalDatabases
- * @return DatabaseBase or null if invalid selection
+ * @param string $database
+ * @param bool $ignoreInvalidDB If true, don't check if $database is in $wgLocalDatabases
+ * @return DatabaseBase|null If invalid selection
*/
public static function getDB( $database, $ignoreInvalidDB = false ) {
global $wgDBname;
/**
* Same as User::getName()
*
- * @return String
+ * @return string
*/
public function getName() {
return $this->name . '@' . $this->database;
/**
* Same as User::getUserPage()
*
- * @return Title object
+ * @return Title
*/
public function getUserPage() {
return Title::makeTitle( NS_USER, $this->getName() );
/**
* Replaces User::addUserGroup()
+ * @param string $group
*/
function addGroup( $group ) {
$this->db->insert( 'user_groups',
/**
* Replaces User::removeUserGroup()
+ * @param string $group
*/
function removeGroup( $group ) {
$this->db->delete( 'user_groups',
/**
* Replaces User::setOption()
+ * @param string $option
+ * @param mixed $value
*/
public function setOption( $option, $value ) {
$this->newOptions[$option] = $value;
/**
* Get a WikiReference object for $wikiID
*
- * @param string $wikiID wiki'd id (generally database name)
- * @return WikiReference object or null if the wiki was not found
+ * @param string $wikiID Wiki'd id (generally database name)
+ * @return WikiReference|null WikiReference object or null if the wiki was not found
*/
public static function getWiki( $wikiID ) {
global $wgConf;
* Convenience to get the wiki's display name
*
* @todo We can give more info than just the wiki id!
- * @param string $wikiID wiki'd id (generally database name)
+ * @param string $wikiID Wiki'd id (generally database name)
* @return string|int Wiki's name or $wiki_id if the wiki was not found
*/
public static function getWikiName( $wikiID ) {
/**
* Convenience to get a link to a user page on a foreign wiki
*
- * @param string $wikiID wiki'd id (generally database name)
- * @param string $user user name (must be normalised before calling this function!)
- * @param string $text link's text; optional, default to "User:$user"
- * @return String: HTML link or false if the wiki was not found
+ * @param string $wikiID Wiki'd id (generally database name)
+ * @param string $user User name (must be normalised before calling this function!)
+ * @param string $text Link's text; optional, default to "User:$user"
+ * @return string HTML link or false if the wiki was not found
*/
public static function foreignUserLink( $wikiID, $user, $text = null ) {
return self::makeForeignLink( $wikiID, "User:$user", $text );
/**
* Convenience to get a link to a page on a foreign wiki
*
- * @param string $wikiID wiki'd id (generally database name)
- * @param string $page page name (must be normalised before calling this function!)
- * @param string $text link's text; optional, default to $page
- * @return String: HTML link or false if the wiki was not found
+ * @param string $wikiID Wiki'd id (generally database name)
+ * @param string $page Page name (must be normalised before calling this function!)
+ * @param string $text Link's text; optional, default to $page
+ * @return string HTML link or false if the wiki was not found
*/
public static function makeForeignLink( $wikiID, $page, $text = null ) {
if ( !$text ) {
/**
* Convenience to get a url to a page on a foreign wiki
*
- * @param string $wikiID wiki'd id (generally database name)
- * @param string $page page name (must be normalised before calling this function!)
- * @return String: URL or false if the wiki was not found
+ * @param string $wikiID Wiki'd id (generally database name)
+ * @param string $page Page name (must be normalised before calling this function!)
+ * @return string|bool URL or false if the wiki was not found
*/
public static function getForeignURL( $wikiID, $page ) {
$wiki = WikiMap::getWiki( $wikiID );
private $mPath; ///< path, '/wiki/$1'
/**
- * @param $major string
- * @param $minor string
- * @param $canonicalServer string
- * @param $path string
- * @param $server null|string
+ * @param string $major
+ * @param string $minor
+ * @param string $canonicalServer
+ * @param string $path
+ * @param null|string $server
*/
public function __construct( $major, $minor, $canonicalServer, $path, $server = null ) {
$this->mMajor = $major;
* Get the the URL in a way to de displayed to the user
* More or less Wikimedia specific
*
- * @return String
+ * @return string
*/
public function getDisplayName() {
$url = $this->getUrl( '' );
* Helper function for getUrl()
*
* @todo FIXME: This may be generalized...
- * @param string $page page name (must be normalised before calling this function!)
- * @return String: Url fragment
+ * @param string $page Page name (must be normalised before calling this function!)
+ * @return string Url fragment
*/
private function getLocalUrl( $page ) {
return str_replace( '$1', wfUrlEncode( str_replace( ' ', '_', $page ) ), $this->mPath );
/**
* Get a canonical (i.e. based on $wgCanonicalServer) URL to a page on this foreign wiki
*
- * @param string $page page name (must be normalised before calling this function!)
- * @return String: Url
+ * @param string $page Page name (must be normalised before calling this function!)
+ * @return string Url
*/
public function getCanonicalUrl( $page ) {
return $this->mCanonicalServer . $this->getLocalUrl( $page );
/**
* Alias for getCanonicalUrl(), for backwards compatibility.
- * @param $page string
- * @return String
+ * @param string $page
+ * @return string
*/
public function getUrl( $page ) {
return $this->getCanonicalUrl( $page );
* Get a URL based on $wgServer, like Title::getFullURL() would produce
* when called locally on the wiki.
*
- * @param string $page page name (must be normalized before calling this function!)
- * @return String: URL
+ * @param string $page Page name (must be normalized before calling this function!)
+ * @return string URL
*/
public function getFullUrl( $page ) {
return $this->mServer .
class TransactionProfiler {
/** @var float seconds */
protected $mDBLockThreshold = 5.0;
- /** @var Array DB/server name => (active trx count,timestamp) */
+ /** @var array DB/server name => (active trx count,timestamp) */
protected $mDBTrxHoldingLocks = array();
- /** @var Array DB/server name => list of (function name, elapsed time) */
+ /** @var array DB/server name => list of (function name, elapsed time) */
protected $mDBTrxMethodTimes = array();
/**
/**
* Return whether this a stub profiler
*
- * @return Boolean
+ * @return bool
*/
public function isStub() {
return false;
* Return whether this profiler stores data
*
* @see Profiler::logData()
- * @return Boolean
+ * @return bool
*/
public function isPersistent() {
return false;
* Only doing collation saves memory overhead but limits the use of certain
* features like that of graph generation for the debug toolbar.
*
- * @return boolean
+ * @return bool
*/
protected function collateOnly() {
return false;
* @param string $name
* @param float $elapsedCpu
* @param float $elapsedReal
- * @param integer $memChange
- * @param integer $subcalls
+ * @param int $memChange
+ * @param int $subcalls
* @param array|null $period Map of ('start','end','memory','subcalls')
*/
protected function updateEntry(
/**
* Called by wfProfieIn()
*
- * @param $functionname String
+ * @param string $functionname
*/
public function profileIn( $functionname ) {
global $wgDebugFunctionEntry;
/**
* Called by wfProfieOut()
*
- * @param $functionname String
+ * @param string $functionname
*/
public function profileOut( $functionname ) {
global $wgDebugFunctionEntry;
/**
* Returns a profiling output to be stored in debug file
*
- * @return String
+ * @return string
*/
public function getOutput() {
global $wgDebugFunctionEntry, $wgProfileCallTree;
* Counts the number of profiled function calls sitting under
* the given point in the call graph. Not the most efficient algo.
*
- * @param $stack Array:
- * @param $start Integer:
- * @return Integer
+ * @param array $stack
+ * @param int $start
+ * @return int
*/
protected function calltreeCount( $stack, $start ) {
$level = $stack[$start][1];