* Issue a standard HTTP 403 Forbidden header ($msg1-a message index, not a message) and an
* error message ($msg2, also a message index), (both required) then end the script
* subsequent arguments to $msg2 will be passed as parameters only for replacing in $msg2
- * @param $msg1
- * @param $msg2
+ * @param string $msg1
+ * @param string $msg2
*/
function wfForbidden( $msg1, $msg2 ) {
global $wgImgAuthDetails;
* Some users might want to use an enhanced list format, for instance
*
* @param IContextSource $context
- * @return ChangesList derivative
+ * @return ChangesList
*/
public static function newFromContext( IContextSource $context ) {
$user = $context->getUser();
/**
* Sets the list to use a "<li class='watchlist-(namespace)-(page)'>" tag
- * @param $value Boolean
+ * @param bool $value
*/
public function setWatchlistDivs( $value = true ) {
$this->watchlist = $value;
}
/**
- * @return bool true when setWatchlistDivs has been called
+ * @return bool True when setWatchlistDivs has been called
* @since 1.23
*/
public function isWatchlist() {
/**
* Returns the appropriate flags for new page, minor change and patrolling
* @param array $flags Associative array of 'flag' => Bool
- * @param string $nothing to use for empty space
+ * @param string $nothing To use for empty space
* @return string
*/
public function recentChangesFlags( $flags, $nothing = ' ' ) {
/**
* Format the character difference of one or several changes.
*
- * @param $old RecentChange
- * @param $new RecentChange last change to use, if not provided, $old will be used
+ * @param RecentChange $old
+ * @param RecentChange $new Last change to use, if not provided, $old will be used
* @return string HTML fragment
*/
public function formatCharacterDifference( RecentChange $old, RecentChange $new = null ) {
/**
* Returns text for the end of RC
- * @return String
+ * @return string
*/
public function endRecentChangesList() {
$out = $this->rclistOpen ? "</ul>\n" : '';
/**
* @param string $s HTML to update
- * @param $rc_timestamp mixed
+ * @param mixed $rc_timestamp
*/
public function insertDateHeader( &$s, $rc_timestamp ) {
# Make date header if necessary
/**
* @param string $s HTML to update
- * @param $title Title
- * @param $logtype string
+ * @param Title $title
+ * @param string $logtype
*/
public function insertLog( &$s, $title, $logtype ) {
$page = new LogPage( $logtype );
/**
* @param string $s HTML to update
- * @param $rc RecentChange
- * @param $unpatrolled
+ * @param RecentChange $rc
+ * @param bool $unpatrolled
*/
public function insertDiffHist( &$s, &$rc, $unpatrolled ) {
# Diff link
/**
* @param string $s HTML to update
- * @param $rc RecentChange
- * @param $unpatrolled
- * @param $watched
+ * @param RecentChange $rc
+ * @param bool $unpatrolled
+ * @param bool $watched
*/
public function insertArticleLink( &$s, &$rc, $unpatrolled, $watched ) {
$params = array();
* Get the timestamp from $rc formatted with current user's settings
* and a separator
*
- * @param $rc RecentChange
+ * @param RecentChange $rc
* @return string HTML fragment
*/
public function getTimestamp( $rc ) {
* Insert time timestamp string from $rc into $s
*
* @param string $s HTML to update
- * @param $rc RecentChange
+ * @param RecentChange $rc
*/
public function insertTimestamp( &$s, $rc ) {
$s .= $this->getTimestamp( $rc );
/**
* Insert links to user page, user talk page and eventually a blocking link
*
- * @param &$s String HTML to update
- * @param &$rc RecentChange
+ * @param string &$s HTML to update
+ * @param RecentChange &$rc
*/
public function insertUserRelatedLinks( &$s, &$rc ) {
if ( $this->isDeleted( $rc, Revision::DELETED_USER ) ) {
/**
* Insert a formatted action
*
- * @param $rc RecentChange
+ * @param RecentChange $rc
* @return string
*/
public function insertLogEntry( $rc ) {
/**
* Insert a formatted comment
- * @param $rc RecentChange
+ * @param RecentChange $rc
* @return string
*/
public function insertComment( $rc ) {
* Check whether to enable recent changes patrol features
*
* @deprecated since 1.22
- * @return Boolean
+ * @return bool
*/
public static function usePatrol() {
global $wgUser;
}
/**
- * @param $link string
- * @param $watched bool
+ * @param string $link
+ * @param bool $watched
* @return string
*/
protected function maybeWatchedLink( $link, $watched = false ) {
/** Inserts a rollback link
*
- * @param $s string
- * @param $rc RecentChange
+ * @param string $s
+ * @param RecentChange $rc
*/
public function insertRollback( &$s, &$rc ) {
if ( $rc->mAttribs['rc_type'] == RC_EDIT
}
/**
- * @param $s string
- * @param $rc RecentChange
- * @param $classes
+ * @param string $s
+ * @param RecentChange $rc
+ * @param array $classes
*/
public function insertTags( &$s, &$rc, &$classes ) {
if ( empty( $rc->mAttribs['ts_tags'] ) ) {
public $watched;
/**
- * @param $rc RecentChange
+ * @param RecentChange $rc
* @return RCCacheEntry
*/
static function newFromParent( $rc ) {
/**
* @param RecentChange $baseRC
- * @param boolean $watched
+ * @param bool $watched
*
* @return RCCacheEntry
*/
* @param RecentChange $cacheEntry
* @param User $user
*
- * @return boolean
+ * @return bool
*/
private function showDiffLinks( RecentChange $cacheEntry, User $user ) {
return ChangesList::userCan( $cacheEntry, Revision::DELETED_TEXT, $user );
/**
* @param RecentChange $cacheEntry
- * @param boolean $showDiffLinks
+ * @param bool $showDiffLinks
* @param int $counter
*
* @return string
/**
* @param RecentChange $cacheEntry
- * @param boolean $showDiffLinks
+ * @param bool $showDiffLinks
* @param int $counter
*
* @return string
/**
* @param RecentChange $cacheEntry
- * @param boolean $showDiffLinks
+ * @param bool $showDiffLinks
*
* @return string
*/
# Factory methods
/**
- * @param $row
+ * @param mixed $row
* @return RecentChange
*/
public static function newFromRow( $row ) {
/**
* No uses left in Gerrit on 2013-11-19.
* @deprecated in 1.22
- * @param $row
+ * @param mixed $row
* @return RecentChange
*/
public static function newFromCurRow( $row ) {
/**
* Find the first recent change matching some specific conditions
*
- * @param array $conds of conditions
- * @param $fname Mixed: override the method name in profiling/logs
- * @param $options Array Query options
+ * @param array $conds Array of conditions
+ * @param mixed $fname Override the method name in profiling/logs
+ * @param array $options Query options
* @return RecentChange
*/
public static function newFromConds( $conds, $fname = __METHOD__, $options = array() ) {
# Accessors
/**
- * @param $attribs array
+ * @param array $attribs
*/
public function setAttribs( $attribs ) {
$this->mAttribs = $attribs;
}
/**
- * @param $extra array
+ * @param array $extra
*/
public function setExtra( $extra ) {
$this->mExtra = $extra;
}
/**
- *
* @return Title
*/
public function &getTitle() {
/**
* Writes the data in this object to the database
- * @param $noudp bool
+ * @param bool $noudp
*/
public function save( $noudp = false ) {
global $wgPutIPinRC, $wgUseEnotif, $wgShowUpdatedMarker, $wgContLang;
/**
* Mark a given change as patrolled
*
- * @param $change Mixed: RecentChange or corresponding rc_id
- * @param $auto Boolean: for automatic patrol
- * @return Array See doMarkPatrolled(), or null if $change is not an existing rc_id
+ * @param RecentChange|int $change RecentChange or corresponding rc_id
+ * @param bool $auto For automatic patrol
+ * @return array See doMarkPatrolled(), or null if $change is not an existing rc_id
*/
public static function markPatrolled( $change, $auto = false ) {
global $wgUser;
*
* NOTE: Can also return 'rcpatroldisabled', 'hookaborted' and
* 'markedaspatrollederror-noautopatrol' as errors
- * @param $user User object doing the action
- * @param $auto Boolean: for automatic patrol
- * @return array of permissions errors, see Title::getUserPermissionsErrors()
+ * @param User $user User object doing the action
+ * @param bool $auto For automatic patrol
+ * @return array Array of permissions errors, see Title::getUserPermissionsErrors()
*/
public function doMarkPatrolled( User $user, $auto = false ) {
global $wgUseRCPatrol, $wgUseNPPatrol;
/**
* Mark this RecentChange patrolled, without error checking
- * @return Integer: number of affected rows
+ * @return int Number of affected rows
*/
public function reallyMarkPatrolled() {
$dbw = wfGetDB( DB_MASTER );
/**
* Makes an entry in the database corresponding to an edit
*
- * @param $timestamp
- * @param $title Title
- * @param $minor
- * @param $user User
- * @param $comment
- * @param $oldId
- * @param $lastTimestamp
- * @param $bot
- * @param $ip string
- * @param $oldSize int
- * @param $newSize int
- * @param $newId int
- * @param $patrol int
+ * @param string $timestamp
+ * @param Title $title
+ * @param bool $minor
+ * @param User $user
+ * @param string $comment
+ * @param int $oldId
+ * @param string $lastTimestamp
+ * @param bool $bot
+ * @param string $ip
+ * @param int $oldSize
+ * @param int $newSize
+ * @param int $newId
+ * @param int $patrol
* @return RecentChange
*/
public static function notifyEdit( $timestamp, &$title, $minor, &$user, $comment, $oldId,
* Makes an entry in the database corresponding to page creation
* Note: the title object must be loaded with the new id using resetArticleID()
*
- * @param $timestamp
- * @param $title Title
- * @param $minor
- * @param $user User
- * @param $comment
- * @param $bot
- * @param $ip string
- * @param $size int
- * @param $newId int
- * @param $patrol int
+ * @param string $timestamp
+ * @param Title $title
+ * @param bool $minor
+ * @param User $user
+ * @param string $comment
+ * @param bool $bot
+ * @param string $ip
+ * @param int $size
+ * @param int $newId
+ * @param int $patrol
* @return RecentChange
*/
public static function notifyNew( $timestamp, &$title, $minor, &$user, $comment, $bot,
}
/**
- * @param $timestamp
- * @param $title
- * @param $user
- * @param $actionComment
- * @param $ip string
- * @param $type
- * @param $action
- * @param $target
- * @param $logComment
- * @param $params
- * @param $newId int
- * @param $actionCommentIRC string
+ * @param string $timestamp
+ * @param Title $title
+ * @param User $user
+ * @param string $actionComment
+ * @param string $ip
+ * @param string $type
+ * @param string $action
+ * @param Title $target
+ * @param string $logComment
+ * @param string $params
+ * @param int $newId
+ * @param string $actionCommentIRC
* @return bool
*/
public static function notifyLog( $timestamp, &$title, &$user, $actionComment, $ip, $type,
}
/**
- * @param $timestamp
- * @param $title Title
- * @param $user User
- * @param $actionComment
- * @param $ip string
- * @param $type
- * @param $action
- * @param $target Title
- * @param $logComment
- * @param $params
- * @param $newId int
- * @param $actionCommentIRC string
+ * @param string $timestamp
+ * @param Title $title
+ * @param User $user
+ * @param string $actionComment
+ * @param string $ip
+ * @param string $type
+ * @param string $action
+ * @param Title $target
+ * @param string $logComment
+ * @param string $params
+ * @param int $newId
+ * @param string $actionCommentIRC
* @return RecentChange
*/
public static function newLogEntry( $timestamp, &$title, &$user, $actionComment, $ip,
/**
* Initialises the members of this object from a mysql row object
*
- * @param $row
+ * @param mixed $row
*/
public function loadFromRow( $row ) {
$this->mAttribs = get_object_vars( $row );
* Makes a pseudo-RC entry from a cur row
*
* @deprecated in 1.22
- * @param $row
+ * @param mixed $row
*/
public function loadFromCurRow( $row ) {
wfDeprecated( __METHOD__, '1.22' );
/**
* Gets the end part of the diff URL associated with this object
* Blank if no diff link should be displayed
- * @param $forceCur
+ * @param bool $forceCur
* @return string
*/
public function diffLinkTrail( $forceCur ) {
/**
* Returns the change size (HTML).
* The lengths can be given optionally.
- * @param $old int
- * @param $new int
+ * @param int $old
+ * @param int $new
* @return string
*/
public function getCharacterDifference( $old = 0, $new = 0 ) {
* as the recentchanges table might not be cleared out regularly (so older entries might exist)
* or rows which will be deleted soon shouldn't be included.
*
- * @param $timestamp mixed MWTimestamp compatible timestamp
- * @param $tolerance integer Tolerance in seconds
+ * @param mixed $timestamp MWTimestamp compatible timestamp
+ * @param int $tolerance Tolerance in seconds
* @return bool
*/
public static function isInRCLifespan( $timestamp, $tolerance = 0 ) {
* Export the resolved user IP, HTTP headers, user ID, and session ID.
* The result will be reasonably sized to allow for serialization.
*
- * @return Array
+ * @return array
* @since 1.21
*/
public function exportSession() {
* Export the resolved user IP, HTTP headers, user ID, and session ID.
* The result will be reasonably sized to allow for serialization.
*
- * @return Array
+ * @return array
* @since 1.21
*/
public function exportSession();
}
/**
- * @param $o OutputPage
+ * @param OutputPage $o
*/
public function setOutput( OutputPage $o ) {
$this->output = $o;
* Export the resolved user IP, HTTP headers, user ID, and session ID.
* The result will be reasonably sized to allow for serialization.
*
- * @return Array
+ * @return array
* @since 1.21
*/
public function exportSession() {
}
/**
- * @param $cats
+ * @param array $cats
*/
function invalidateCategories( $cats ) {
$this->invalidatePages( NS_CATEGORY, array_keys( $cats ) );
}
/**
- * @param $images
+ * @param array $images
*/
function invalidateImageDescriptions( $images ) {
$this->invalidatePages( NS_FILE, array_keys( $images ) );
/**
* Get an array of category insertions
*
- * @param array $existing mapping existing category names to sort keys. If both
+ * @param array $existing Mapping existing category names to sort keys. If both
* match a link in $this, the link will be omitted from the output
*
* @return array
/**
* Get an array of interlanguage link insertions
*
- * @param array $existing mapping existing language codes to titles
+ * @param array $existing Mapping existing language codes to titles
*
* @return array
*/
/**
* Get an array of existing categories, with the name in the key and sort key in the value.
*
- * @return array of property names and values
+ * @return array Array of property names and values
*/
private function getExistingProperties() {
$res = $this->mDb->select( 'page_props', array( 'pp_propname', 'pp_value' ),
/**
* Fetch page links added by this LinksUpdate. Only available after the update is complete.
* @since 1.22
- * @return null|array of Titles
+ * @return null|array Array of Titles
*/
public function getAddedLinks() {
if ( $this->linkInsertions === null ) {
/**
* Fetch page links removed by this LinksUpdate. Only available after the update is complete.
* @since 1.22
- * @return null|array of Titles
+ * @return null|array Array of Titles
*/
public function getRemovedLinks() {
if ( $this->linkDeletions === null ) {
/**
* Format a diff.
*
- * @param Diff $diff A Diff object.
+ * @param Diff $diff
*
* @return string The formatted output.
*/
* @param int $xlen
* @param int $ybeg
* @param int $ylen
- * @param $edits
+ * @param array $edits
*
* @throws MWException If the edit type is not known.
*/
/**
* Constructor
*
- * @param $httpCode Integer: HTTP status code to send to the client
- * @param string|Message $content content of the message
- * @param string|Message $header content of the header (\<title\> and \<h1\>)
+ * @param int $httpCode HTTP status code to send to the client
+ * @param string|Message $content Content of the message
+ * @param string|Message $header Content of the header (\<title\> and \<h1\>)
*/
public function __construct( $httpCode, $content, $header = null ) {
parent::__construct( $content );
* Whether to log this exception in the exception debug log.
*
* @since 1.23
- * @return boolean
+ * @return bool
*/
public function isLoggable() {
return true;
/**
* Run hook to allow extensions to modify the text of the exception
*
- * @param string $name class name of the exception
- * @param array $args arguments to pass to the callback functions
- * @return string|null string to output or null if any hook has been called
+ * @param string $name Class name of the exception
+ * @param array $args Arguments to pass to the callback functions
+ * @return string|null String to output or null if any hook has been called
*/
public function runHooks( $name, $args = array() ) {
global $wgExceptionHooks;
/**
* Get a message from i18n
*
- * @param string $key message name
- * @param string $fallback default message if the message cache can't be
+ * @param string $key Message name
+ * @param string $fallback Default message if the message cache can't be
* called by the exception
* The function also has other parameters that are arguments for the message
- * @return string message with arguments replaced
+ * @return string Message with arguments replaced
*/
public function msg( $key, $fallback /*[, params...] */ ) {
$args = array_slice( func_get_args(), 2 );
* backtrace to the error, otherwise show a message to ask to set it to true
* to show that information.
*
- * @return string html to output
+ * @return string Html to output
*/
public function getHTML() {
global $wgShowExceptionDetails;
/**
* Report an exception to the user
+ * @param Exception $e
*/
protected static function report( Exception $e ) {
global $wgShowExceptionDetails;
* } catch ( Exception $e ) {
* echo $e->__toString();
* }
+ * @param Exception $e
*/
public static function handle( $e ) {
global $wgFullyInitialised;
* @param Exception $e
* @param bool $pretty Add non-significant whitespace to improve readability (default: false).
* @param int $escaping Bitfield consisting of FormatJson::.*_OK class constants.
- * @return string|bool: JSON string if successful; false upon failure
+ * @return string|bool JSON string if successful; false upon failure
*/
public static function jsonSerializeException( Exception $e, $pretty = false, $escaping = 0 ) {
global $wgLogExceptionBacktrace;
* class itself as a parameter.
*
* @param string $url A partial external store URL ("<store type>://<location>")
- * @param $data string
+ * @param string $data
* @param array $params Associative array of ExternalStoreMedium parameters
* @return string|bool The URL of the stored data item, or false on error
* @throws MWException
}
/**
- * @param $data string
- * @param $wiki string
+ * @param string $data
+ * @param string $wiki
* @return string|bool The URL of the stored data item, or false on error
* @throws MWException
*/
/**
* Get a LoadBalancer for the specified cluster
*
- * @param string $cluster cluster name
- * @return LoadBalancer object
+ * @param string $cluster Cluster name
+ * @return LoadBalancer
*/
function getLoadBalancer( $cluster ) {
$wiki = isset( $this->params['wiki'] ) ? $this->params['wiki'] : false;
/**
* Get a slave database connection for the specified cluster
*
- * @param string $cluster cluster name
- * @return DatabaseBase object
+ * @param string $cluster Cluster name
+ * @return DatabaseBase
*/
function getSlave( $cluster ) {
global $wgDefaultExternalStore;
/**
* Get a master database connection for the specified cluster
*
- * @param string $cluster cluster name
- * @return DatabaseBase object
+ * @param string $cluster Cluster name
+ * @return DatabaseBase
*/
function getMaster( $cluster ) {
$wiki = isset( $this->params['wiki'] ) ? $this->params['wiki'] : false;
/**
* Get the 'blobs' table name for this database
*
- * @param $db DatabaseBase
- * @return String: table name ('blobs' by default)
+ * @param DatabaseBase $db
+ * @return string Table name ('blobs' by default)
*/
function getTable( $db ) {
$table = $db->getLBInfo( 'blobs table' );
* Fetch a blob item out of the database; a cache of the last-loaded
* blob will be kept so that multiple loads out of a multi-item blob
* can avoid redundant database access and decompression.
- * @param $cluster
- * @param $id
- * @param $itemID
+ * @param string $cluster
+ * @param string $id
+ * @param string $itemID
* @return mixed
* @private
*/
* @since 1.21
*/
abstract class ExternalStoreMedium {
- /** @var Array */
+ /** @var array */
protected $params = array();
/**
/**
* Insert a data item into a given location
*
- * @param string $location the location name
- * @param string $data the data item
+ * @param string $location The location name
+ * @param string $data The data item
* @return string|bool The URL of the stored data item, or false on error
* @throws MWException
*/
* Get a new image gallery. This is the method other callers
* should use to get a gallery.
*
- * @param string|bool $mode Mode to use. False to use the default.
+ * @param string|bool $mode Mode to use. False to use the default
* @throws MWException
*/
static function factory( $mode = false ) {
* @note This also triggers using the page's target
* language instead of the user language.
*
- * @param $parser Parser
+ * @param Parser $parser
*/
function setParser( $parser ) {
$this->mParser = $parser;
* to allow extensions to add additional parameters to
* <gallery> parser tag.
*
- * @param array $options Attributes of gallery tag.
+ * @param array $options Attributes of gallery tag
*/
public function setAdditionalOptions( $options ) {
}
* Enable/Disable showing of the file size of an image in the gallery.
* Enabled by default.
*
- * @param bool $f Set to false to disable.
+ * @param bool $f Set to false to disable
*/
function setShowBytes( $f ) {
$this->mShowBytes = (bool)$f;
* Enable/Disable showing of the filename of an image in the gallery.
* Enabled by default.
*
- * @param bool $f Set to false to disable.
+ * @param bool $f Set to false to disable
*/
function setShowFilename( $f ) {
$this->mShowFilename = (bool)$f;
* Sends some text to the specified live feed.
*
* @see RecentChange::cleanupForIRC
- * @param array $feed The feed, as configured in an associative array.
- * @param string $line The text to send.
- * @return boolean success
+ * @param array $feed The feed, as configured in an associative array
+ * @param string $line The text to send
+ * @return bool success
*/
public function send( array $feed, $line );
}
/**
* Stream a thumbnail specified by parameters
*
- * @param $params Array List of thumbnailing parameters. In addition to parameters
+ * @param array $params List of thumbnailing parameters. In addition to parameters
* passed to the MediaHandler, this may also includes the keys:
* f (for filename), archived (if archived file), temp (if temp file),
* w (alias for width), p (alias for page), r (ignored; historical),
*
* Transform specific parameters are set later via wfExtractThumbParams().
*
- * @param $thumbRel String Thumbnail path relative to the thumb zone
- * @return Array|null associative params array or null
+ * @param string $thumbRel Thumbnail path relative to the thumb zone
+ * @return array|null Associative params array or null
*/
function wfExtractThumbRequestInfo( $thumbRel ) {
$repo = RepoGroup::singleton()->getLocalRepo();
* Convert a thumbnail name (122px-foo.png) to parameters, using
* file handler.
*
- * @param File $file File object for file in question.
- * @param $param Array Array of parameters so far.
- * @return Array parameters array with more parameters.
+ * @param File $file File object for file in question
+ * @param array $param Array of parameters so far
+ * @return array Parameters array with more parameters
*/
function wfExtractThumbParams( $file, $params ) {
if ( !isset( $params['thumbName'] ) ) {
/**
* Output a thumbnail generation error message
*
- * @param $status integer
- * @param $msg string
+ * @param int $status
+ * @param string $msg
* @return void
*/
function wfThumbError( $status, $msg ) {