* enabled.
*
* @since 1.19
- * @param $out OutputPage
+ * @param OutputPage $out
*/
public static function addModules( OutputPage $out ) {
if ( self::$enabled ) {
* @todo Add support for passing objects
*
* @since 1.19
- * @param $str string
+ * @param string $str
*/
public static function log( $str ) {
if ( !self::$enabled ) {
* Adds a warning entry to the log
*
* @since 1.19
- * @param $msg string
- * @param $callerOffset int
- * @param $level int A PHP error level. See sendMessage()
- * @param $log string: 'production' will always trigger a php error, 'auto'
- * will trigger an error if $wgDevelopmentWarnings is true, and 'debug'
- * will only write to the debug log(s).
+ * @param string $msg
+ * @param int $callerOffset
+ * @param int $level A PHP error level. See sendMessage()
+ * @param string $log 'production' will always trigger a php error, 'auto'
+ * will trigger an error if $wgDevelopmentWarnings is true, and 'debug'
+ * will only write to the debug log(s).
*
* @return mixed
*/
* @param string $function Function that is deprecated.
* @param string|bool $version Version in which the function was deprecated.
* @param string|bool $component Component to which the function belongs.
- * If false, it is assumbed the function is in MediaWiki core.
- * @param $callerOffset integer: How far up the callstack is the original
+ * If false, it is assumbed the function is in MediaWiki core.
+ * @param int $callerOffset How far up the callstack is the original
* caller. 2 = function that called the function that called
* MWDebug::deprecated() (Added in 1.20).
* @return mixed
/**
* Get an array describing the calling function at a specified offset.
*
- * @param $callerOffset integer: How far up the callstack is the original
+ * @param int $callerOffset How far up the callstack is the original
* caller. 0 = function that called getCallerDescription()
- * @return array with two keys: 'file' and 'func'
+ * @return array Array with two keys: 'file' and 'func'
*/
private static function getCallerDescription( $callerOffset ) {
$callers = wfDebugBacktrace();
* Send a message to the debug log and optionally also trigger a PHP
* error, depending on the $level argument.
*
- * @param $msg string Message to send
- * @param $caller array caller description get from getCallerDescription()
- * @param $group string log group on which to send the message
- * @param $level int|bool error level to use; set to false to not trigger an error
+ * @param string $msg Message to send
+ * @param array $caller Caller description get from getCallerDescription()
+ * @param string $group Log group on which to send the message
+ * @param int|bool $level Error level to use; set to false to not trigger an error
*/
private static function sendMessage( $msg, $caller, $group, $level ) {
$msg .= ' [Called from ' . $caller['func'] . ' in ' . $caller['file'] . ']';
* Do NOT use this method, use MWDebug::log or wfDebug()
*
* @since 1.19
- * @param $str string
+ * @param string $str
*/
public static function debugMsg( $str ) {
global $wgDebugComments, $wgShowDebug;
* Begins profiling on a database query
*
* @since 1.19
- * @param $sql string
- * @param $function string
- * @param $isMaster bool
+ * @param string $sql
+ * @param string $function
+ * @param bool $isMaster
* @return int ID number of the query to pass to queryTime or -1 if the
* debugger is disabled
*/
* Calculates how long a query took.
*
* @since 1.19
- * @param $id int
+ * @param int $id
*/
public static function queryTime( $id ) {
if ( $id === -1 || !self::$enabled ) {
/**
* Returns a list of files included, along with their size
*
- * @param $context IContextSource
+ * @param IContextSource $context
* @return array
*/
protected static function getFilesIncluded( IContextSource $context ) {
* Returns the HTML to add to the page for the toolbar
*
* @since 1.19
- * @param $context IContextSource
+ * @param IContextSource $context
* @return string
*/
public static function getDebugHTML( IContextSource $context ) {
/**
* Append the debug info to given ApiResult
*
- * @param $context IContextSource
- * @param $result ApiResult
+ * @param IContextSource $context
+ * @param ApiResult $result
*/
public static function appendDebugInfoToApiResult( IContextSource $context, ApiResult $result ) {
if ( !self::$enabled ) {
/**
* Returns the HTML to add to the page for the toolbar
*
- * @param $context IContextSource
+ * @param IContextSource $context
* @return array
*/
public static function getDebugInfo( IContextSource $context ) {
* Get a string representation of a title suitable for
* including in a search index
*
- * @return String a stripped-down title string ready for the search index
+ * @return string A stripped-down title string ready for the search index
*/
private function indexTitle() {
global $wgContLang;
public function getDeleted();
/**
- * @param $field Integer: one of LogPage::DELETED_* bitfield constants
- * @return Boolean
+ * @param int $field One of LogPage::DELETED_* bitfield constants
+ * @return bool
*/
public function isDeleted( $field );
}
*
* @since 1.19
*
- * @param integer $deleted
+ * @param int $deleted
*/
public function setDeleted( $deleted ) {
$this->deleted = $deleted;
/**
* Publishes the log entry.
- * @param int $newId id of the log entry.
- * @param string $to rcandudp (default), rc, udp
+ * @param int $newId Id of the log entry.
+ * @param string $to One of: rcandudp (default), rc, udp
*/
public function publish( $newId, $to = 'rcandudp' ) {
$log = new LogPage( $this->getType() );
public $flags;
/**
- * @var Array
+ * @var array
*/
protected $mDefaultQuery;
}
/**
- * @param $pattern
+ * @param string $pattern
* @return string Checkbox
*/
private function getTitlePattern( $pattern ) {
/**
* Handy shortcut for constructing a formatter directly from
* database row.
- * @param $row
+ * @param object $row
* @see DatabaseLogEntry::getSelectQueryData
* @return LogFormatter
*/
/** @var LogEntryBase */
protected $entry;
- /** @var Integer Constant for handling log_deleted */
+ /** @var int Constant for handling log_deleted */
protected $audience = self::FOR_PUBLIC;
/** @var bool Whether to output user tool links */
*
* @param LogEventsList $list
* @param string|array $types Log types to show
- * @param string $performer the user who made the log entries
- * @param string|Title $title the page title the log entries are for
- * @param string $pattern do a prefix search rather than an exact title match
- * @param array $conds extra conditions for the query
+ * @param string $performer The user who made the log entries
+ * @param string|Title $title The page title the log entries are for
+ * @param string $pattern Do a prefix search rather than an exact title match
+ * @param array $conds Extra conditions for the query
* @param int|bool $year The year to start from. Default: false
* @param int|bool $month The month to start from. Default: false
- * @param string $tagFilter tag
+ * @param string $tagFilter Tag
*/
public function __construct( $list, $types = array(), $performer = '', $title = '', $pattern = '',
$conds = array(), $year = false, $month = false, $tagFilter = '' ) {
/**
* Checks if $this->mConds has $field matched to a *single* value
- * @param $field
+ * @param string $field
* @return bool
*/
protected function hasEqualsClause( $field ) {
/** @var string All workers with the same key share the lock */
protected $key;
- /** @var integer Maximum number of workers doing the task simultaneously */
+ /** @var int Maximum number of workers doing the task simultaneously */
protected $workers;
- /** @var integer If this number of workers are already working/waiting, fail instead of wait */
+ /** @var int If this number of workers are already working/waiting, fail instead of wait */
protected $maxqueue;
/** @var float Maximum time in seconds to wait for the lock */
protected $timeout;
/**
* Create a Pool counter. This should only be called from the PoolWorks.
*
- * @param $type
- * @param $key
+ * @param string $type
+ * @param string $key
*
* @return PoolCounter
*/
protected $serversByLabel;
/** @var string SHA-1 of the key */
protected $keySha1;
- /** @var integer TTL for locks to expire (work should finish in this time) */
+ /** @var int TTL for locks to expire (work should finish in this time) */
protected $lockTTL;
/** @var RedisConnRef */
protected $conn;
/** @var string Pool slot value */
protected $slot;
- /** @var integer AWAKE_* constant */
+ /** @var int AWAKE_* constant */
protected $onRelease;
/** @var string Unique string to identify this process */
protected $session;
- /** @var integer UNIX timestamp */
+ /** @var int UNIX timestamp */
protected $slotTime;
const AWAKE_ONE = 1; // wake-up if when a slot can be taken from an existing process
const AWAKE_ALL = 2; // wake-up if an existing process finishes and wake up such others
- /** @var Array List of active PoolCounterRedis objects in this script */
+ /** @var array List of active PoolCounterRedis objects in this script */
protected static $active = null;
function __construct( $conf, $type, $key ) {
/**
* Actually perform the work, caching it if needed
- * @return mixed work result or false
+ * @return mixed Work result or false
*/
abstract public function doWork();
/**
* Retrieve the work from cache
- * @return mixed work result or false
+ * @return mixed Work result or false
*/
public function getCachedWork() {
return false;
/**
* A work not so good (eg. expired one) but better than an error
* message.
- * @return mixed work result or false
+ * @return mixed Work result or false
*/
public function fallback() {
return false;
/**
* Log an error
*
- * @param $status Status
+ * @param Status $status
* @return void
*/
public function logError( $status ) {
* - c) fallback() : Applies for all remaining cases.
* If these all fall through (by returning false), then the result of error() is returned.
*
- * @param $skipcache bool
+ * @param bool $skipcache
* @return mixed
*/
public function execute( $skipcache = false ) {
/** @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();
/** @var Profiler */
/**
* Set the profiler to a specific profiler instance. Mostly for dumpHTML
- * @param $p Profiler object
+ * @param Profiler $p
*/
public static function setInstance( Profiler $p ) {
self::$__instance = $p;
/**
* 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;
/**
* Whether to internally just track aggregates and ignore the full stack trace
*
- * @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;
/**
* Mark this call as templated or not
*
- * @param $t Boolean
+ * @param bool $t
*/
public function setTemplated( $t ) {
$this->mTemplated = $t;
/**
* Returns a profiling output to be stored in debug file
*
- * @return String
+ * @return string
*/
public function getOutput() {
global $wgDebugFunctionEntry, $wgProfileCallTree;
* Get the initial time of the request, based either on $wgRequestTime or
* $wgRUstart. Will return null if not able to find data.
*
- * @param string|false $metric metric to use, with the following possibilities:
+ * @param string|false $metric Metric to use, with the following possibilities:
* - user: User CPU time (without system calls)
* - cpu: Total CPU time (user and system calls)
* - wall (or any other string): elapsed time
* Get the initial time of the request, based either on $wgRequestTime or
* $wgRUstart. Will return null if not able to find data.
*
- * @param string|false $metric metric to use, with the following possibilities:
+ * @param string|false $metric Metric to use, with the following possibilities:
* - user: User CPU time (without system calls)
* - cpu: Total CPU time (user and system calls)
* - wall (or any other string): elapsed time
/**
* Dummy calls to wfProfileIn/wfProfileOut to calculate its overhead
+ *
+ * @param int $profileCount
*/
protected static function calculateOverhead( $profileCount ) {
wfProfileIn( '-overhead-total' );
* 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];
/**
* Add an entry in the debug log file
*
- * @param string $s to output
+ * @param string $s String to output
*/
protected function debug( $s ) {
if ( function_exists( 'wfDebug' ) ) {
* Add an entry in the debug log group
*
* @param string $group Group to send the message to
- * @param string $s to output
+ * @param string $s String to output
*/
protected function debugGroup( $group, $s ) {
if ( function_exists( 'wfDebugLog' ) ) {
}
/**
- * @param $db DatabaseBase
+ * @param DatabaseBase $db
* @return mixed
*/
public function doQuery( $db ) {
}
/**
- * @param $db DatabaseBase
+ * @param DatabaseBase $db
* @return mixed
*/
public function doQuery( $db ) {
var $storeBatch, $deleteBatch, $cleanupBatch;
/**
- * @param $db DatabaseBase
+ * @param DatabaseBase $db
* @return mixed
*/
public function doQuery( $db ) {
}
/**
- * @param $db DatabaseBase
+ * @param DatabaseBase $db
* @return mixed
*/
public function doQuery( $db ) {
}
/**
- * @param $db DatabaseBase
+ * @param DatabaseBase $db
* @return mixed
*/
public function doQuery( $db ) {
* If the update fails because it did not match, the function should return
* false. This prevents concurrency problems.
*
- * @return boolean success
+ * @return bool Success
*/
abstract public function setBits( $newBits );
/**
* Update *_deleted bitfields in various tables to hide or unhide usernames
- * @param $name String username
- * @param $userId Int user id
- * @param $op String operator '|' or '&'
- * @param $dbw null|DatabaseBase, if you happen to have one lying around
+ * @param string $name Username
+ * @param int $userId User id
+ * @param string $op Operator '|' or '&'
+ * @param null|DatabaseBase $dbw If you happen to have one lying around
* @return bool
*/
private static function setUsernameBitfields( $name, $userId, $op, $dbw ) {
*
* @param string $desc description to add to the array if the option was
* enabled / disabled.
- * @param $field Integer: the bitmask describing the single option.
- * @param $diff Integer: the xor of the old and new bitfields.
- * @param $new Integer: the new bitfield
- * @param array $arr the array to update.
+ * @param int $field The bitmask describing the single option.
+ * @param int $diff The xor of the old and new bitfields.
+ * @param int $new The new bitfield
+ * @param array $arr The array to update.
*/
protected static function checkItem( $desc, $field, $diff, $new, &$arr ) {
if ( $diff & $field ) {
* You can turn the keys in $arr[0] and $arr[1] into message keys by
* appending -hid and and -unhid to the keys respectively.
*
- * @param $n Integer: the new bitfield.
- * @param $o Integer: the old bitfield.
+ * @param int $n The new bitfield.
+ * @param int $o The old bitfield.
* @return array An array as described above.
* @since 1.19 public
*/
* If it doesn't, returns the corresponding ar_timestamp field
* so that this key can be used instead.
*
- * @param $title Title
- * @param $revid
+ * @param Title $title
+ * @param int $revid
* @return bool|mixed
*/
public static function checkRevisionExistence( $title, $revid ) {
/**
* Put together a rev_deleted bitfield
* @since 1.22
- * @param array $bitPars extractBitParams() params
- * @param int $oldfield current bitfield
+ * @param array $bitPars ExtractBitParams() params
+ * @param int $oldfield Current bitfield
* @return array
*/
public static function extractBitfield( $bitPars, $oldfield ) {
* @since 1.21
* @deprecated Just use the constructor or the factory Site::newForType
*
- * @param integer $globalId
+ * @param int $globalId
*
* @return MediaWikiSite
*/
*
* @since 1.21
*
- * @param string $title the target page's title, in normalized form.
+ * @param string $title The target page's title, in normalized form.
*
- * @return String
+ * @return string
*/
public function toDBKey( $title ) {
return str_replace( ' ', '_', $title );
* @param array $externalData A reply from the API on a external server.
* @param string $pageTitle Identifies the page at the external site, needing normalization.
*
- * @return array|boolean a 'page' structure representing the page identified by $pageTitle.
+ * @return array|bool A 'page' structure representing the page identified by $pageTitle.
*/
private static function extractPageRecord( $externalData, $pageTitle ) {
// If there is a special case with only one returned page
*
* @since 1.21
*
- * @param string|boolean $pageName Page name or false (default: false)
+ * @param string|bool $pageName Page name or false (default: false)
*
* @return string
*/
*
* @since 1.21
*
- * @param string|boolean $path
+ * @param string|bool $path
*
* @return string
*/
*
* @since 1.21
*
- * @return boolean
+ * @return bool
*/
public function shouldForward() {
return $this->forward;
*
* @since 1.21
*
- * @param boolean $shouldForward
+ * @param bool $shouldForward
*
* @throws MWException
*/
*
* @since 1.21
*
- * @param bool|String $pageName
+ * @param bool|string $pageName
*
- * @return string|boolean false
+ * @return string|bool
*/
public function getPageUrl( $pageName = false ) {
$url = $this->getLinkPath();
*
* @since 1.21
*
- * @var array of integer
+ * @var array Array of integer
*/
protected $byInternalId = array();
*
* @since 1.21
*
- * @var array of string
+ * @var array Array of string
*/
protected $byGlobalId = array();
*
* @since 1.23
*
- * @var array of string
+ * @var array Array of string
*/
protected $byNavigationId = array();
* @param int|string $index
* @param Site $site
*
- * @return boolean
+ * @return bool
*/
protected function preSetElement( $index, $site ) {
if ( $this->hasSite( $site->getGlobalId() ) ) {
*
* @param string $globalSiteId
*
- * @return boolean
+ * @return bool
*/
public function hasSite( $globalSiteId ) {
return array_key_exists( $globalSiteId, $this->byGlobalId );
*
* @since 1.21
*
- * @return boolean
+ * @return bool
*/
public function isEmpty() {
return $this->byGlobalId === array();
/**
* Returns if the list contains the site with the provided site id.
*
- * @param integer $id
+ * @param int $id
*
- * @return boolean
+ * @return bool
*/
public function hasInternalId( $id ) {
return array_key_exists( $id, $this->byInternalId );
*
* @since 1.21
*
- * @param integer $id
+ * @param int $id
*
* @return Site
*/
*
* @since 1.21
*
- * @param integer $id
+ * @param int $id
*/
public function removeSiteByInternalId( $id ) {
$this->offsetUnset( $this->byInternalId[$id] );
*
* @param string $id
*
- * @return boolean
+ * @return bool
*/
public function hasNavigationId( $id ) {
return array_key_exists( $id, $this->byNavigationId );
*
* @see SiteList::getSerialVersionId
*
- * @return String The cache key.
+ * @return string The cache key.
*/
protected function getCacheKey() {
wfProfileIn( __METHOD__ );
*
* @since 1.21
*
- * @param string $source either 'cache' or 'recache'
+ * @param string $source Either 'cache' or 'recache'
*
* @return SiteList
*/
*
* @param Site $site
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
public function saveSite( Site $site ) {
return $this->saveSites( array( $site ) );
*
* @param Site[] $sites
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
public function saveSites( array $sites ) {
wfProfileIn( __METHOD__ );
*
* @see SiteStore::clear()
*
- * @return bool success
+ * @return bool Success
*/
public function clear() {
wfProfileIn( __METHOD__ );
* @since 1.21
* @deprecated
*
- * @param string|boolean false $globalId
+ * @param string|bool $globalId
*
* @return Site
*/
/**
* @deprecated
+ * @param string $group
* @return SiteList
*/
public function getSiteGroup( $group ) {
*
* @param Site $site
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
public function saveSite( Site $site );
*
* @param Site[] $sites
*
- * @return boolean Success indicator
+ * @return bool Success indicator
*/
public function saveSites( array $sites );
* @since 1.21
*
* @param string $globalId
- * @param string $source either 'cache' or 'recache'.
+ * @param string $source Either 'cache' or 'recache'.
* If 'cache', the values are allowed (but not obliged) to come from a cache.
*
* @return Site|null
*
* @since 1.21
*
- * @param string $source either 'cache' or 'recache'.
+ * @param string $source Either 'cache' or 'recache'.
* If 'cache', the values are allowed (but not obliged) to come from a cache.
*
* @return SiteList
* @param string $text
*
* @throws InvalidArgumentException if the namespace is invalid
- * @return String
+ * @return string
*/
public function getNamespaceName( $namespace, $text ) {
if ( $this->language->needsGenderDistinction() &&
* Parses the given text and constructs a TitleValue. Normalization
* is applied according to the rules appropriate for the form specified by $form.
*
- * @param string $text the text to parse
- * @param int $defaultNamespace namespace to assume per default (usually NS_MAIN)
+ * @param string $text The text to parse
+ * @param int $defaultNamespace Namespace to assume per default (usually NS_MAIN)
*
* @throws MalformedTitleException
* @return TitleValue
* @param string $text
*
* @throws InvalidArgumentException
- * @return String
+ * @return string
*/
public function getNamespaceName( $namespace, $text );
}
* un-normalized text when constructing TitleValues. For constructing a TitleValue from
* user input or external sources, use a TitleParser.
*
- * @param $namespace int The namespace ID. This is not validated.
- * @param $dbkey string The page title in valid DBkey form. No normalization is applied.
- * @param $fragment string The fragment title. Use '' to represent the whole page.
- * No validation or normalization is applied.
+ * @param int $namespace The namespace ID. This is not validated.
+ * @param string $dbkey The page title in valid DBkey form. No normalization is applied.
+ * @param string $fragment The fragment title. Use '' to represent the whole page.
+ * No validation or normalization is applied.
*
* @throws InvalidArgumentException
*/