*
* @param string $cookieValue The string in which to find the ID.
*
- * @return integer|null The block ID, or null if the HMAC is present and invalid.
+ * @return int|null The block ID, or null if the HMAC is present and invalid.
*/
public static function getIdFromCookieValue( $cookieValue ) {
// Extract the ID prefix from the cookie value (may be the whole value, if no bang found).
/**
* Set up all member variables using a database query.
- * @param integer $mode
+ * @param int $mode
* @throws MWException
* @return bool True on success, false on failure.
*/
/** @var string */
public $edittime = '';
- /** @var integer */
+ /** @var int */
private $editRevId = null;
/** @var string */
* - 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,
+ * - nullEdit (bool): Set if doEditContent is OK. True if null edit,
* false otherwise.
* - redirect (bool): Set if doEditContent is OK. True if resulting
* revision is a redirect.
}
/**
- * @param integer $n Number of jobs to try to run
+ * @param int $n Number of jobs to try to run
* @param LoggerInterface $runJobsLogger
*/
private function triggerSyncJobs( $n, LoggerInterface $runJobsLogger ) {
}
/**
- * @param integer $n Number of jobs to try to run
+ * @param int $n Number of jobs to try to run
* @param LoggerInterface $runJobsLogger
* @return bool Success
*/
/** @var MWTimestamp|bool Timestamp upto which history from the source will be merged */
protected $timestampLimit;
- /** @var integer Number of revisions merged (for Special:MergeHistory success message) */
+ /** @var int Number of revisions merged (for Special:MergeHistory success message) */
protected $revisionsMerged;
/**
* the TTL is higher the older the $mtime timestamp is. Essentially, the
* TTL is 90% of the age of the object, subject to the min and max.
*
- * @param string|integer|float|bool|null $mtime Last-Modified timestamp
- * @param integer $minTTL Mimimum TTL in seconds [default: 1 minute]
- * @param integer $maxTTL Maximum TTL in seconds [default: $wgSquidMaxage]
- * @return integer TTL in seconds
+ * @param string|int|float|bool|null $mtime Last-Modified timestamp
+ * @param int $minTTL Mimimum TTL in seconds [default: 1 minute]
+ * @param int $maxTTL Maximum TTL in seconds [default: $wgSquidMaxage]
+ * @return int TTL in seconds
* @since 1.28
*/
public function adaptCdnTTL( $mtime, $minTTL = 0, $maxTTL = 0 ) {
* This should only be used for proposed revisions that turn out to be null edits
*
* @since 1.28
- * @param integer $id User ID
+ * @param int $id User ID
* @param string $name User name
*/
public function setUserIdAndName( $id, $name ) {
* Get the text cache TTL
*
* @param WANObjectCache $cache
- * @return integer
+ * @return int
*/
private static function getCacheTTL( WANObjectCache $cache ) {
global $wgRevisionCacheExpiry;
/**
* @param bool|IDatabase $database
- * - boolean: Whether to use the master DB
+ * - bool: Whether to use the master DB
* - IDatabase: Database connection to use
*/
public function __construct( $database = false ) {
* for the original initStats, but without output.
*
* @param IDatabase|bool $database
- * - boolean: Whether to use the master DB
+ * - bool: Whether to use the master DB
* - IDatabase: Database connection to use
* @param array $options Array of options, may contain the following values
- * - activeUsers boolean: Whether to update the number of active users (default: false)
+ * - activeUsers bool: Whether to update the number of active users (default: false)
*/
public static function doAllAndCommit( $database, array $options = [] ) {
$options += [ 'update' => false, 'activeUsers' => false ];
* @param array $headers Any additional headers to send if the file exists
* @param bool $sendErrors Send error messages if errors occur (like 404)
* @param array $optHeaders HTTP request header map (e.g. "range") (use lowercase keys)
- * @param integer $flags Bitfield of STREAM_* constants
+ * @param int $flags Bitfield of STREAM_* constants
* @throws MWException
* @return bool Success
*/
* Send out a standard 404 message for a file
*
* @param string $fname Full name and path of the file to stream
- * @param integer $flags Bitfield of STREAM_* constants
+ * @param int $flags Bitfield of STREAM_* constants
* @since 1.24
*/
public static function send404Message( $fname, $flags = 0 ) {
* Convert a Range header value to an absolute (start, end) range tuple
*
* @param string $range Range header value
- * @param integer $size File size
+ * @param int $size File size
* @return array|string Returns error string on failure (start, end, length)
* @since 1.24
*/
/**
* List all submodules of a module
* @param ApiBase $module
- * @param boolean $recursive
+ * @param bool $recursive
* @return string[]
*/
private function listAllSubmodules( ApiBase $module, $recursive ) {
* @param AuthenticationRequest[] &$reqs
* @param string $action
* @param string|null $username
- * @param boolean $forceAction
+ * @param bool $forceAction
*/
private function fillRequests( array &$reqs, $action, $username, $forceAction = false ) {
foreach ( $reqs as $req ) {
* Indicate whether this request contains any state for the specified
* action.
* @param string $action One of the AuthManager::ACTION_* constants
- * @return boolean
+ * @return bool
*/
public function hasStateForAction( $action ) {
switch ( $action ) {
* Indicate whether this request contains state for the specified
* action sufficient to replace other primary-required requests.
* @param string $action One of the AuthManager::ACTION_* constants
- * @return boolean
+ * @return bool
*/
public function hasPrimaryStateForAction( $action ) {
switch ( $action ) {
/**
* Check if pages can be cached for this request/user
* @param IContextSource $context
- * @param integer $mode One of the HTMLFileCache::MODE_* constants (since 1.28)
+ * @param int $mode One of the HTMLFileCache::MODE_* constants (since 1.28)
* @return bool
*/
public static function useFileCache( IContextSource $context, $mode = self::MODE_NORMAL ) {
/**
* Read from cache to context output
* @param IContextSource $context
- * @param integer $mode One of the HTMLFileCache::MODE_* constants
+ * @param int $mode One of the HTMLFileCache::MODE_* constants
* @return void
*/
public function loadFromFileCache( IContextSource $context, $mode = self::MODE_NORMAL ) {
* is disabled.
*
* @param string $code Language to which load messages
- * @param integer $mode Use MessageCache::FOR_UPDATE to skip process cache [optional]
+ * @param int $mode Use MessageCache::FOR_UPDATE to skip process cache [optional]
* @throws MWException
* @return bool
*/
/**
* @param string $code
* @param array &$where List of wfDebug() comments
- * @param integer $mode Use MessageCache::FOR_UPDATE to use DB_MASTER
+ * @param int $mode Use MessageCache::FOR_UPDATE to use DB_MASTER
* @return bool|string True on success or one of ("cantacquire", "disabled")
*/
protected function loadFromDBWithLock( $code, array &$where, $mode = null ) {
* on-demand from the database later.
*
* @param string $code Language code
- * @param integer $mode Use MessageCache::FOR_UPDATE to skip process cache
+ * @param int $mode Use MessageCache::FOR_UPDATE to skip process cache
* @return array Loaded messages for storing in caches
*/
protected function loadFromDB( $code, $mode = null ) {
/**
* @param string $key A language message cache key that stores blobs
- * @param integer $timeout Wait timeout in seconds
+ * @param int $timeout Wait timeout in seconds
* @return null|ScopedCallback
*/
protected function getReentrantScopedLock( $key, $timeout = self::WAIT_SEC ) {
/** @var Language */
protected $digitTransformLanguage;
- /** @var boolean */
+ /** @var bool */
private $useNumericCollation = false;
/** @var array */
private $directory;
/** @var string */
private $encoding;
- /** @var integer */
+ /** @var int */
private $baseCacheTTL;
- /** @var integer */
+ /** @var int */
private $skewCacheTTL;
- /** @var integer */
+ /** @var int */
private $timeout;
/**
*/
class DBAccessObjectUtils implements IDBAccessObject {
/**
- * @param integer $bitfield
- * @param integer $flags IDBAccessObject::READ_* constant
+ * @param int $bitfield
+ * @param int $flags IDBAccessObject::READ_* constant
* @return bool Bitfield has flag $flag set
*/
public static function hasFlags( $bitfield, $flags ) {
* The fallback DB index and options are to be used if the entity is not found
* with the initial DB index, typically querying the master DB to avoid lag
*
- * @param integer $bitfield Bitfield of IDBAccessObject::READ_* constants
+ * @param int $bitfield Bitfield of IDBAccessObject::READ_* constants
* @return array List of DB indexes and options in this order:
* - DB_MASTER or DB_REPLICA constant for the initial query
* - SELECT options array for the initial query
*/
interface IDBAccessObject {
/** Constants for object loading bitfield flags (higher => higher QoS) */
- /** @var integer Read from a replica DB/non-quorum */
+ /** @var int Read from a replica DB/non-quorum */
const READ_NORMAL = 0;
- /** @var integer Read from the master/quorum */
+ /** @var int Read from the master/quorum */
const READ_LATEST = 1;
- /* @var integer Read from the master/quorum and lock out other writers */
+ /* @var int Read from the master/quorum and lock out other writers */
const READ_LOCKING = 3; // READ_LATEST (1) and "LOCK IN SHARE MODE" (2)
- /** @var integer Read from the master/quorum and lock out other writers and locking readers */
+ /** @var int Read from the master/quorum and lock out other writers and locking readers */
const READ_EXCLUSIVE = 7; // READ_LOCKING (3) and "FOR UPDATE" (4)
- /** @var integer Read from a replica DB or without a quorum, using the master/quorum on miss */
+ /** @var int Read from a replica DB or without a quorum, using the master/quorum on miss */
const READ_LATEST_IMMUTABLE = 8;
// Convenience constant for tracking how data was loaded (higher => higher QoS)
* In CLI mode, callback magic will also be used to run updates when safe
*
* @param DeferrableUpdate $update Some object that implements doUpdate()
- * @param integer $stage DeferredUpdates constant (PRESEND or POSTSEND) (since 1.27)
+ * @param int $stage DeferredUpdates constant (PRESEND or POSTSEND) (since 1.27)
*/
public static function addUpdate( DeferrableUpdate $update, $stage = self::POSTSEND ) {
global $wgCommandLineMode;
* @see MWCallableUpdate::__construct()
*
* @param callable $callable
- * @param integer $stage DeferredUpdates constant (PRESEND or POSTSEND) (since 1.27)
+ * @param int $stage DeferredUpdates constant (PRESEND or POSTSEND) (since 1.27)
* @param IDatabase|null $dbw Abort if this DB is rolled back [optional] (since 1.28)
*/
public static function addCallableUpdate(
* Do any deferred updates and clear the list
*
* @param string $mode Use "enqueue" to use the job queue when possible [Default: "run"]
- * @param integer $stage DeferredUpdates constant (PRESEND, POSTSEND, or ALL) (since 1.27)
+ * @param int $stage DeferredUpdates constant (PRESEND, POSTSEND, or ALL) (since 1.27)
*/
public static function doUpdates( $mode = 'run', $stage = self::ALL ) {
$stageEffective = ( $stage === self::ALL ) ? self::POSTSEND : $stage;
*
* @param DeferrableUpdate[] &$queue List of DeferrableUpdate objects
* @param string $mode Use "enqueue" to use the job queue when possible
- * @param integer $stage Class constant (PRESEND, POSTSEND) (since 1.28)
+ * @param int $stage Class constant (PRESEND, POSTSEND) (since 1.28)
* @throws ErrorPageError Happens on top-level calls
* @throws Exception Happens on second-level calls
*/
* @param DeferrableUpdate $update
* @param LBFactory $lbFactory
* @param string $mode
- * @param integer $stage
+ * @param int $stage
* @return ErrorPageError|null
*/
private static function runUpdate(
}
/**
- * @return integer Number of enqueued updates
+ * @return int Number of enqueued updates
* @since 1.28
*/
public static function pendingUpdatesCount() {
}
/**
- * @param integer $stage DeferredUpdates constant (PRESEND, POSTSEND, or ALL)
+ * @param int $stage DeferredUpdates constant (PRESEND, POSTSEND, or ALL)
* @return DeferrableUpdate[]
* @since 1.29
*/
class LinksDeletionUpdate extends DataUpdate implements EnqueueableDataUpdate {
/** @var WikiPage */
protected $page;
- /** @var integer */
+ /** @var int */
protected $pageId;
/** @var string */
protected $timestamp;
/**
* @param WikiPage $page Page we are updating
- * @param integer|null $pageId ID of the page we are updating [optional]
+ * @param int|null $pageId ID of the page we are updating [optional]
* @param string|null $timestamp TS_MW timestamp of deletion
* @throws MWException
*/
* Acquire a lock for performing link table updates for a page on a DB
*
* @param IDatabase $dbw
- * @param integer $pageId
+ * @param int $pageId
* @param string $why One of (job, atomicity)
* @return ScopedCallback
* @throws RuntimeException
/**
* @param Exception|Throwable $e Original exception
- * @param integer $mode MWExceptionExposer::AS_* constant
+ * @param int $mode MWExceptionExposer::AS_* constant
* @param Exception|Throwable|null $eNew New exception from attempting to show the first
*/
public static function output( $e, $mode, $eNew = null ) {
}
/**
- * @param integer $code
+ * @param int $code
*/
private static function statusHeader( $code ) {
if ( !headers_sent() ) {
/**
* Get a connection to the repo file registry DB
*
- * @param integer $index
+ * @param int $index
* @return DBConnRef
*/
protected function getDB( $index ) {
* @param string $url
* @param string $timeout
* @param array $options
- * @param integer|bool &$mtime Resulting Last-Modified UNIX timestamp if received
+ * @param int|bool &$mtime Resulting Last-Modified UNIX timestamp if received
* @return bool|string
*/
public static function httpGet(
*
* Overridden by LocalFile to actually query the DB
*
- * @param integer $flags Bitfield of File::READ_* constants
+ * @param int $flags Bitfield of File::READ_* constants
*/
public function load( $flags = 0 ) {
}
* 'novalidate' attribute will be added on the `<form>` element. It will be removed if the user
* agent has JavaScript support, in htmlform.js.
*
- * @return boolean
+ * @return bool
* @since 1.29
*/
public function needsJSForHtml5FormValidation() {
* (wpFormIdentifier).
*
* @param WebRequest $request
- * @return boolean
+ * @return bool
*/
protected function isSubmitAttempt( WebRequest $request ) {
return $request->getCheck( 'wpEditToken' ) || $request->getCheck( 'wpFormIdentifier' );
* Whether this field requires the user agent to have JavaScript enabled for the client-side HTML5
* form validation to work correctly.
*
- * @return boolean
+ * @return bool
* @since 1.29
*/
public function needsJSForHtml5FormValidation() {
/** @var string $mButtonClass CSS class for the button in this field */
protected $mButtonClass = '';
- /** @var string|integer $mButtonId Element ID for the button in this field */
+ /** @var string|int $mButtonId Element ID for the button in this field */
protected $mButtonId = '';
/** @var string $mButtonName Name the button in this field */
* @since 1.27
*/
class CategoryMembershipChangeJob extends Job {
- /** @var integer|null */
+ /** @var int|null */
private $ticket;
const ENQUEUE_FUDGE_SEC = 60;
class RefreshLinksJob extends Job {
/** @var float Cache parser output when it takes this long to render */
const PARSE_THRESHOLD_SEC = 1.0;
- /** @var integer Lag safety margin when comparing root job times to last-refresh times */
+ /** @var int Lag safety margin when comparing root job times to last-refresh times */
const CLOCK_FUDGE = 10;
- /** @var integer How many seconds to wait for replica DBs to catch up */
+ /** @var int How many seconds to wait for replica DBs to catch up */
const LAG_WAIT_TIMEOUT = 15;
function __construct( Title $title, array $params ) {
/**
* @see SiteList::getNewOffset()
* @since 1.20
- * @var integer
+ * @var int
*/
protected $indexOffset = 0;
*
* @since 1.20
*
- * @return integer
+ * @return int
*/
protected function getNewOffset() {
while ( $this->offsetExists( $this->indexOffset ) ) {
*
* @since 1.20
*
- * @param integer|string $index
+ * @param int|string $index
* @param mixed $value
*
* @return bool
protected $liveRing;
/** @var Array (location => UNIX timestamp) */
protected $ejectionExpiries = [];
- /** @var integer UNIX timestamp */
+ /** @var int UNIX timestamp */
protected $ejectionNextExpiry = INF;
const RING_SIZE = 268435456; // 2^28
* Get the location of an item on the ring, as well as the next locations
*
* @param string $item
- * @param integer $limit Maximum number of locations to return
+ * @param int $limit Maximum number of locations to return
* @return array List of locations
*/
public function getLocations( $item, $limit ) {
* Remove a location from the "live" hash ring
*
* @param string $location
- * @param integer $ttl Seconds
+ * @param int $ttl Seconds
* @return bool Whether some non-ejected locations are left
*/
public function ejectFromLiveRing( $location, $ttl ) {
* Get the location of an item on the "live" ring, as well as the next locations
*
* @param string $item
- * @param integer $limit Maximum number of locations to return
+ * @param int $limit Maximum number of locations to return
* @return array List of locations
* @throws UnexpectedValueException
*/
protected $multiHandle = null; // curl_multi handle
/** @var string|null SSL certificates path */
protected $caBundlePath;
- /** @var integer */
+ /** @var int */
protected $connTimeout = 10;
- /** @var integer */
+ /** @var int */
protected $reqTimeout = 300;
/** @var bool */
protected $usePipelining = false;
- /** @var integer */
+ /** @var int */
protected $maxConnsPerHost = 50;
/** @var string|null proxy */
protected $proxy;
* @param array $headers Any additional headers to send if the file exists
* @param bool $sendErrors Send error messages if errors occur (like 404)
* @param array $optHeaders HTTP request header map (e.g. "range") (use lowercase keys)
- * @param integer $flags Bitfield of STREAM_* constants
+ * @param int $flags Bitfield of STREAM_* constants
* @throws MWException
* @return bool Success
*/
* Send out a standard 404 message for a file
*
* @param string $fname Full name and path of the file to stream
- * @param integer $flags Bitfield of STREAM_* constants
+ * @param int $flags Bitfield of STREAM_* constants
* @since 1.24
*/
public static function send404Message( $fname, $flags = 0 ) {
* Convert a Range header value to an absolute (start, end) range tuple
*
* @param string $range Range header value
- * @param integer $size File size
+ * @param int $size File size
* @return array|string Returns error string on failure (start, end, length)
* @since 1.24
*/
abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
/** @var array[] Lock tracking */
protected $locks = [];
- /** @var integer ERR_* class constant */
+ /** @var int ERR_* class constant */
protected $lastError = self::ERR_NONE;
/** @var string */
protected $keyspace = 'local';
protected $logger;
/** @var callback|null */
protected $asyncHandler;
- /** @var integer Seconds */
+ /** @var int Seconds */
protected $syncTimeout;
/** @var bool */
/** @var callable[] */
protected $busyCallbacks = [];
- /** @var integer[] Map of (ATTR_* class constant => QOS_* class constant) */
+ /** @var int[] Map of (ATTR_* class constant => QOS_* class constant) */
protected $attrMap = [];
/** Possible values for getLastError() */
* @param string $key
* @param int $ttl Time-to-live (seconds)
* @param callable $callback Callback that derives the new value
- * @param integer $flags Bitfield of BagOStuff::READ_* constants [optional]
+ * @param int $flags Bitfield of BagOStuff::READ_* constants [optional]
* @return mixed The cached value if found or the result of $callback otherwise
* @since 1.27
*/
* higher tiers using standard TTLs.
*
* @param string $key
- * @param integer $flags Bitfield of BagOStuff::READ_* constants [optional]
- * @param integer $oldFlags [unused]
+ * @param int $flags Bitfield of BagOStuff::READ_* constants [optional]
+ * @param int $oldFlags [unused]
* @return mixed Returns false on failure and if the item does not exist
*/
public function get( $key, $flags = 0, $oldFlags = null ) {
/**
* @param string $key
- * @param integer $flags Bitfield of BagOStuff::READ_* constants [optional]
+ * @param int $flags Bitfield of BagOStuff::READ_* constants [optional]
* @return mixed Returns false on failure and if the item does not exist
*/
abstract protected function doGet( $key, $flags = 0 );
*
* @param string $key
* @param mixed &$casToken
- * @param integer $flags Bitfield of BagOStuff::READ_* constants [optional]
+ * @param int $flags Bitfield of BagOStuff::READ_* constants [optional]
* @return mixed Returns false on failure and if the item does not exist
* @throws Exception
*/
/**
* Get an associative array containing the item for each of the keys that have items.
* @param array $keys List of strings
- * @param integer $flags Bitfield; supports READ_LATEST [optional]
+ * @param int $flags Bitfield; supports READ_LATEST [optional]
* @return array
*/
public function getMulti( array $keys, $flags = 0 ) {
}
/**
- * @param integer $flag ATTR_* class constant
- * @return integer QOS_* class constant
+ * @param int $flag ATTR_* class constant
+ * @return int QOS_* class constant
* @since 1.28
*/
public function getQoS( $flag ) {
* Merge the flag maps of one or more BagOStuff objects into a "lowest common denominator" map
*
* @param BagOStuff[] $bags
- * @return integer[] Resulting flag map (class ATTR_* constant => class QOS_* constant)
+ * @return int[] Resulting flag map (class ATTR_* constant => class QOS_* constant)
*/
protected function mergeFlagMaps( array $bags ) {
$map = [];
class HashBagOStuff extends BagOStuff {
/** @var mixed[] */
protected $bag = [];
- /** @var integer Max entries allowed */
+ /** @var int Max entries allowed */
protected $maxCacheKeys;
const KEY_VAL = 0;
/**
* Apply a write method to the first $count backing caches
*
- * @param integer $count
+ * @param int $count
* @param bool $asyncWrites
* @param string $method
* @param mixed $args,...
/**
* @param string $key
- * @param integer $flags Bitfield of BagOStuff::READ_* constants [optional]
+ * @param int $flags Bitfield of BagOStuff::READ_* constants [optional]
* @return mixed Returns false on failure and if the item does not exist
*/
protected function doGet( $key, $flags = 0 ) {
/** @var int ERR_* constant for the "last error" registry */
protected $lastRelayError = self::ERR_NONE;
- /** @var integer Callback stack depth for getWithSetCallback() */
+ /** @var int Callback stack depth for getWithSetCallback() */
private $callbackDepth = 0;
/** @var mixed[] Temporary warm-up cache */
private $warmupCache = [];
- /** @var integer Key fetched */
+ /** @var int Key fetched */
private $warmupKeyMisses = 0;
/** Max time expected to pass between delete() and DB commit finishing */
const FLD_FLAGS = 4; // key to the flags bitfield
const FLD_HOLDOFF = 5; // key to any hold-off TTL
- /** @var integer Treat this value as expired-on-arrival */
+ /** @var int Treat this value as expired-on-arrival */
const FLG_STALE = 1;
const ERR_NONE = 0; // no error
*
* @param string $key Cache key
* @param mixed $value
- * @param integer $ttl Seconds to live. Special values are:
+ * @param int $ttl Seconds to live. Special values are:
* - WANObjectCache::TTL_INDEFINITE: Cache forever
* @param array $opts Options map:
* - lag : Seconds of replica DB lag. Typically, this is either the replica DB lag
* idempotence, the $ttl should not vary for different delete() calls on the same key.
*
* @param string $key Cache key
- * @param integer $ttl Tombstone TTL; Default: WANObjectCache::HOLDOFF_TTL
+ * @param int $ttl Tombstone TTL; Default: WANObjectCache::HOLDOFF_TTL
* @return bool True if the item was purged or not found, false on failure
*/
final public function delete( $key, $ttl = self::HOLDOFF_TTL ) {
* @see WANObjectCache::set()
*
* @param string $key Cache key
- * @param integer $ttl Seconds to live for key updates. Special values are:
+ * @param int $ttl Seconds to live for key updates. Special values are:
* - WANObjectCache::TTL_INDEFINITE: Cache forever
* - WANObjectCache::TTL_UNCACHEABLE: Do not cache at all
* @param callable $callback Value generation function
* @see WANObjectCache::getWithSetCallback()
*
* @param string $key
- * @param integer $ttl
+ * @param int $ttl
* @param callback $callback
* @param array $opts Options map for getWithSetCallback()
* @param float &$asOf Cache generation timestamp of returned value [returned]
* @endcode
*
* @param ArrayIterator $keyedIds Result of WANObjectCache::makeMultiKeys()
- * @param integer $ttl Seconds to live for key updates
+ * @param int $ttl Seconds to live for key updates
* @param callable $callback Callback the yields entity regeneration callbacks
* @param array $opts Options map
* @return array Map of (cache key => value) in the same order as $keyedIds
* @endcode
*
* @param ArrayIterator $keyedIds Result of WANObjectCache::makeMultiKeys()
- * @param integer $ttl Seconds to live for key updates
+ * @param int $ttl Seconds to live for key updates
* @param callable $callback Callback the yields entity regeneration callbacks
* @param array $opts Options map
* @return array Map of (cache key => value) in the same order as $keyedIds
}
/**
- * @param integer $flag ATTR_* class constant
- * @return integer QOS_* class constant
+ * @param int $flag ATTR_* class constant
+ * @return int QOS_* class constant
* @since 1.28
*/
public function getQoS( $flag ) {
* $ttl = $cache->adaptiveTTL( $mtime, $cache::TTL_DAY );
* @endcode
*
- * @param integer|float $mtime UNIX timestamp
- * @param integer $maxTTL Maximum TTL (seconds)
- * @param integer $minTTL Minimum TTL (seconds); Default: 30
+ * @param int|float $mtime UNIX timestamp
+ * @param int $maxTTL Maximum TTL (seconds)
+ * @param int $minTTL Minimum TTL (seconds); Default: 30
* @param float $factor Value in the range (0,1); Default: .2
- * @return integer Adaptive TTL
+ * @return int Adaptive TTL
* @since 1.28
*/
public function adaptiveTTL( $mtime, $maxTTL, $minTTL = 30, $factor = .2 ) {
}
/**
- * @return integer Number of warmup key cache misses last round
+ * @return int Number of warmup key cache misses last round
* @since 1.30
*/
public function getWarmupKeyMisses() {
* This must set the key to "PURGED:<UNIX timestamp>:<holdoff>"
*
* @param string $key Cache key
- * @param integer $ttl How long to keep the tombstone [seconds]
- * @param integer $holdoff HOLDOFF_* constant controlling how long to ignore sets for this key
+ * @param int $ttl How long to keep the tombstone [seconds]
+ * @param int $holdoff HOLDOFF_* constant controlling how long to ignore sets for this key
* @return bool Success
*/
protected function relayPurge( $key, $ttl, $holdoff ) {
* and get hits too. Similar to worthRefreshExpiring(), randomization is used.
*
* @param float $asOf UNIX timestamp of the value
- * @param integer $ageNew Age of key when this might recommend refreshing (seconds)
- * @param integer $timeTillRefresh Age of key when it should be refreshed if popular (seconds)
+ * @param int $ageNew Age of key when this might recommend refreshing (seconds)
+ * @param int $timeTillRefresh Age of key when it should be refreshed if popular (seconds)
* @param float $now The current UNIX timestamp
* @return bool
*/
* Do not use this method outside WANObjectCache
*
* @param mixed $value
- * @param integer $ttl [0=forever]
+ * @param int $ttl [0=forever]
* @param float $now Unix Current timestamp just before calling set()
* @return array
*/
/** @var string */
protected $channel;
- /** @var integer */
+ /** @var int */
protected $initialStartWindow;
/**
/** @var float[] Map of (DB master name => 1) */
protected $shutdownTouchDBs = [];
- /** @var integer Seconds to store positions */
+ /** @var int Seconds to store positions */
const POSITION_TTL = 60;
- /** @var integer Max time to wait for positions to appear */
+ /** @var int Max time to wait for positions to appear */
const POS_WAIT_TIMEOUT = 5;
/**
* With conflicting expectations, the most narrow ones will be used
*
* @param string $event (writes,queries,conns,mConns)
- * @param integer $value Maximum count of the event
+ * @param int $value Maximum count of the event
* @param string $fname Caller
* @since 1.25
*/
* @param string $query Function name or generalized SQL
* @param float $sTime Starting UNIX wall time
* @param bool $isWrite Whether this is a write query
- * @param integer $n Number of affected rows
+ * @param int $n Number of affected rows
*/
public function recordQueryCompletion( $query, $sTime, $isWrite = false, $n = 0 ) {
$eTime = microtime( true );
* @param string $db DB name
* @param string $id ID string of transaction
* @param float $writeTime Time spent in write queries
- * @param integer $affected Number of rows affected by writes
+ * @param int $affected Number of rows affected by writes
*/
public function transactionWritingOut( $server, $db, $id, $writeTime = 0.0, $affected = 0 ) {
$name = "{$server} ({$db}) (TRX#$id)";
protected $mTablePrefix = '';
/** @var string */
protected $mSchema = '';
- /** @var integer */
+ /** @var int */
protected $mFlags;
/** @var array */
protected $mLBInfo = [];
*/
private $mTrxWriteDuration = 0.0;
/**
- * @var integer Number of write queries for the current transaction
+ * @var int Number of write queries for the current transaction
*/
private $mTrxWriteQueryCount = 0;
/**
- * @var integer Number of rows affected by write queries for the current transaction
+ * @var int Number of rows affected by write queries for the current transaction
*/
private $mTrxWriteAffectedRows = 0;
/**
*/
private $mTrxWriteAdjDuration = 0.0;
/**
- * @var integer Number of write queries counted in mTrxWriteAdjDuration
+ * @var int Number of write queries counted in mTrxWriteAdjDuration
*/
private $mTrxWriteAdjQueryCount = 0;
/**
*
* @param string $sql A SQL write query
* @param float $runtime Total runtime, including RTT
- * @param integer $affected Affected row count
+ * @param int $affected Affected row count
*/
private function updateTrxWriteQueryTime( $sql, $runtime, $affected ) {
// Whether this is indicative of replica DB runtime (except for RBR or ws_repl)
/**
* Do not use this method outside of Database/DBError classes
*
- * @param integer|string $errno
+ * @param int|string $errno
* @return bool Whether the given query error was a connection drop
*/
public function wasConnectionError( $errno ) {
*
* This method should not be used outside of Database/LoadBalancer
*
- * @param integer $trigger IDatabase::TRIGGER_* constant
+ * @param int $trigger IDatabase::TRIGGER_* constant
* @since 1.20
* @throws Exception
*/
*
* This method should not be used outside of Database/LoadBalancer
*
- * @param integer $trigger IDatabase::TRIGGER_* constant
+ * @param int $trigger IDatabase::TRIGGER_* constant
* @throws Exception
* @since 1.20
*/
/**
* Get the number of affected rows from pending write queries
*
- * @return integer
+ * @return int
* @since 1.30
*/
public function pendingWriteRowsAffected();
/**
* @param string $file Binlog file name
- * @param integer $pos Binlog position
+ * @param int $pos Binlog position
* @param string $gtid Comma separated GTID set [optional]
*/
function __construct( $file, $pos, $gtid = '' ) {
use stdClass;
class MssqlResultWrapper extends ResultWrapper {
- /** @var integer|null */
+ /** @var int|null */
private $mSeekTo = null;
/**
class DBQueryError extends DBExpectedError {
/** @var string */
public $error;
- /** @var integer */
+ /** @var int */
public $errno;
/** @var string */
public $sql;
/**
* Prepare all tracked load balancers for shutdown
- * @param integer $mode One of the class SHUTDOWN_* constants
+ * @param int $mode One of the class SHUTDOWN_* constants
* @param callable|null $workCallback Work to mask ChronologyProtector writes
*/
public function shutdown(
private $mGroupLoads;
/** @var bool Whether to disregard replica DB lag as a factor in replica DB selection */
private $mAllowLagged;
- /** @var integer Seconds to spend waiting on replica DB lag to resolve */
+ /** @var int Seconds to spend waiting on replica DB lag to resolve */
private $mWaitTimeout;
/** @var array The LoadMonitor configuration */
private $loadMonitorConfig;
/** @var Database DB connection object that caused a problem */
private $errorConnection;
- /** @var integer The generic (not query grouped) replica DB index (of $mServers) */
+ /** @var int The generic (not query grouped) replica DB index (of $mServers) */
private $mReadIndex;
/** @var bool|DBMasterPos False if not set */
private $mWaitForPos;
private $mLastError = 'Unknown error';
/** @var string|bool Reason the LB is read-only or false if not */
private $readOnlyReason = false;
- /** @var integer Total connections opened */
+ /** @var int Total connections opened */
private $connsOpened = 0;
/** @var string|bool String if a requested DBO_TRX transaction round is active */
private $trxRoundId = false;
/** @var callable Exception logger */
private $errorLogger;
- /** @var boolean */
+ /** @var bool */
private $disabled = false;
- /** @var boolean */
+ /** @var bool */
private $chronProtInitialized = false;
- /** @var integer Warn when this many connection are held */
+ /** @var int Warn when this many connection are held */
const CONN_HELD_WARN_THRESHOLD = 10;
- /** @var integer Default 'max lag' when unspecified */
+ /** @var int Default 'max lag' when unspecified */
const MAX_LAG_DEFAULT = 10;
- /** @var integer Seconds to cache master server read-only status */
+ /** @var int Seconds to cache master server read-only status */
const TTL_CACHE_READONLY = 5;
const KEY_LOCAL = 'local';
*
* @param int $i Server index
* @param string $domain Domain ID to open
- * @param integer $flags Class CONN_* constant bitfield
+ * @param int $flags Class CONN_* constant bitfield
* @return Database
*/
private function openForeignConnection( $i, $domain, $flags = 0 ) {
*
* Values may be "false" if replication is too broken to estimate
*
- * @param integer[] $serverIndexes
+ * @param int[] $serverIndexes
* @param string $domain
* @return array Map of (server index => float|int|bool)
*/
}
/**
- * @param integer $index Server index
+ * @param int $index Server index
* @param IDatabase|null $conn Connection handle or null on connection failure
* @return float
*/
/**
* Check whether this data factory has any data.
- * @return boolean
+ * @return bool
*/
public function hasData() {
return !empty( $this->buffer );
interface IBufferingStatsdDataFactory extends StatsdDataFactoryInterface {
/**
* Check whether this data factory has any data.
- * @return boolean
+ * @return bool
*/
public function hasData();
* This function creates a 'updateCount' StatsdData object.
*
* @param string|array $key The metric(s) to decrement.
- * @param integer $delta The delta to add to the each metric
+ * @param int $delta The delta to add to the each metric
*
* @return mixed
*/
/**
* Check whether this data factory has any data.
- * @return boolean
+ * @return bool
*/
public function hasData() {
return false;
* strings are not allowed here as sampleData requires a StatsdDataInterface
* @param int $sampleRate
*
- * @return integer the data sent in bytes
+ * @return int the data sent in bytes
*/
public function send( $data, $sampleRate = 1 ) {
if ( !is_array( $data ) ) {
/**
* Check if the page can be cached
- * @param integer $mode One of the HTMLFileCache::MODE_* constants (since 1.28)
+ * @param int $mode One of the HTMLFileCache::MODE_* constants (since 1.28)
* @return bool
*/
public function isFileCacheable( $mode = HTMLFileCache::MODE_NORMAL ) {
/**
* @param Content $content Pre-save transform content
- * @param integer $flags
+ * @param int $flags
* @param User $user
* @param string $summary
* @param array $meta
/**
* @param Content $content Pre-save transform content
- * @param integer $flags
+ * @param int $flags
* @param User $user
* @param string $summary
* @param array $meta
* @param Revision $revision
* @param User $user User object that did the revision
* @param array $options Array of options, following indexes are used:
- * - changed: boolean, whether the revision changed the content (default true)
- * - created: boolean, whether the revision created the page (default false)
- * - moved: boolean, whether the page was moved (default false)
- * - restored: boolean, whether the page was undeleted (default false)
+ * - changed: bool, whether the revision changed the content (default true)
+ * - created: bool, whether the revision created the page (default false)
+ * - moved: bool, whether the page was moved (default false)
+ * - restored: bool, whether the page was undeleted (default false)
* - oldrevision: Revision object for the pre-update revision (default null)
- * - oldcountable: boolean, null, or string 'no-change' (default null):
- * - boolean: whether the page was counted as an article before that
+ * - oldcountable: bool, null, or string 'no-change' (default null):
+ * - bool: whether the page was counted as an article before that
* revision, only used in changed is true and created is false
* - null: if created is false, don't update the article count; if created
* is true, do update the article count
/**
* Lock the page row for this title+id and return page_latest (or 0)
*
- * @return integer Returns 0 if no row was found with this title+id
+ * @return int Returns 0 if no row was found with this title+id
* @since 1.27
*/
public function lockAndGetLatest() {
*
* @param array $added The names of categories that were added
* @param array $deleted The names of categories that were deleted
- * @param integer $id Page ID (this should be the original deleted page ID)
+ * @param int $id Page ID (this should be the original deleted page ID)
*/
public function updateCategoryCounts( array $added, array $deleted, $id = 0 ) {
$id = $id ?: $this->getId();
*/
private $mFlags = [];
- /** @var integer|null Assumed rev ID for {{REVISIONID}} if no revision is set */
+ /** @var int|null Assumed rev ID for {{REVISIONID}} if no revision is set */
private $mSpeculativeRevId;
- /** @var integer Upper bound of expiry based on parse duration */
+ /** @var int Upper bound of expiry based on parse duration */
private $mMaxAdaptiveExpiry = INF;
const EDITSECTION_REGEX =
}
/**
- * @param integer $id
+ * @param int $id
* @since 1.28
*/
public function setSpeculativeRevIdUsed( $id ) {
/**
* Lower the runtime adaptive TTL to at most this value
*
- * @param integer $ttl
+ * @param int $ttl
* @since 1.28
*/
public function updateRuntimeAdaptiveExpiry( $ttl ) {
* store array can be accessed via getNextSibling().
*
* @param array $store
- * @param integer $index
+ * @param int $index
*/
public function __construct( array $store, $index ) {
$this->store = $store;
* on what is at the relevant store index.
*
* @param array $store
- * @param integer $index
+ * @param int $index
* @return PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text
*/
public static function factory( array $store, $index ) {
* return a temporary proxy object: different instances will be returned
* if this is called more than once on the same node.
*
- * @return PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text|boolean
+ * @return PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text|bool
*/
public function getFirstChild() {
if ( !isset( $this->rawChildren[0] ) ) {
* return a temporary proxy object: different instances will be returned
* if this is called more than once on the same node.
*
- * @return PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text|boolean
+ * @return PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text|bool
*/
public function getNextSibling() {
return self::factory( $this->store, $this->index + 1 );
* store array can be accessed via getNextSibling().
*
* @param array $store
- * @param integer $index
+ * @param int $index
*/
public function __construct( array $store, $index ) {
$this->value = $store[$index];
* store array can be accessed via getNextSibling().
*
* @param array $store
- * @param integer $index
+ * @param int $index
*/
public function __construct( array $store, $index ) {
$descriptor = $store[$index];
/**
* Get the current deletion bitfield value
*
- * @return integer
+ * @return int
*/
abstract public function getBits();
* @since 1.22
* @param array $bitPars ExtractBitParams() params
* @param int $oldfield Current bitfield
- * @return integer
+ * @return int
*/
public static function extractBitfield( array $bitPars, $oldfield ) {
// Build the actual new rev_deleted bitfield
private $serviceInstantiators = [];
/**
- * @var boolean[] disabled status, per service name
+ * @var bool[] disabled status, per service name
*/
private $disabled = [];
private $extraInstantiationParams;
/**
- * @var boolean
+ * @var bool
*/
private $destroyed = false;
* Cookies that are session-length do not call this function.
*
* @param string $cookieName
- * @param boolean $shouldRememberUser Whether the user should be remembered
+ * @param bool $shouldRememberUser Whether the user should be remembered
* long-term
* @return int Cookie expiration time in seconds; 0 for session cookies
*/
protected $totalCount = 0, $totalBytes = 0;
/**
- * @var integer $totalPerType Combined file size of all files in a section
+ * @var int $totalPerType Combined file size of all files in a section
*/
protected $totalPerType = 0;
/**
- * @var integer $totalSize Combined file size of all files
+ * @var int $totalSize Combined file size of all files
*/
protected $totalSize = 0;
/**
* Determine whether an element is in the list of formatting elements.
* @param BalanceElement $elt
- * @return boolean
+ * @return bool
*/
public function isInList( BalanceElement $elt ) {
return $this->head === $elt || $elt->prevAFE;
* Insert a p-wrapper
*
* @param SerializerNode $parent
- * @param integer $sourceStart
+ * @param int $sourceStart
* @return SerializerNode
*/
private function insertPWrapper( SerializerNode $parent, $sourceStart ) {
* FIXME: fostering ($preposition == BEFORE) is mostly done by inserting as
* normal, the full algorithm is not followed.
*
- * @param integer $preposition
+ * @param int $preposition
* @param Element|SerializerNode|null $refElement
* @param Element $element
* @param bool $void
- * @param integer $sourceStart
- * @param integer $sourceLength
+ * @param int $sourceStart
+ * @param int $sourceLength
*/
public function insertElement( $preposition, $refElement, Element $element, $void,
$sourceStart, $sourceLength
*
* @param SerializerNode $parentNode
* @param bool $inline
- * @param integer $pos The source position
+ * @param int $pos The source position
* @return SerializerNode
*/
private function splitTagStack( SerializerNode $parentNode, $inline, $pos ) {
/**
* @param string $tempPath File system path to temporary file containing the upload
- * @param integer $fileSize
+ * @param int $fileSize
*/
protected function setTempFile( $tempPath, $fileSize = null ) {
$this->mTempPath = $tempPath;
/** @var Block */
private $mBlockedFromCreateAccount = false;
- /** @var integer User::READ_* constant bitfield used to load data */
+ /** @var int User::READ_* constant bitfield used to load data */
protected $queryFlagsUsed = self::READ_NORMAL;
public static $idCacheByName = [];
/**
* Load the user table data for this object from the source given by mFrom.
*
- * @param integer $flags User::READ_* constant bitfield
+ * @param int $flags User::READ_* constant bitfield
*/
public function load( $flags = self::READ_NORMAL ) {
global $wgFullyInitialised;
/**
* Load user table data, given mId has already been set.
- * @param integer $flags User::READ_* constant bitfield
+ * @param int $flags User::READ_* constant bitfield
* @return bool False if the ID does not exist, true otherwise
*/
public function loadFromId( $flags = self::READ_NORMAL ) {
/**
* @since 1.27
* @param string $wikiId
- * @param integer $userId
+ * @param int $userId
*/
public static function purge( $wikiId, $userId ) {
$cache = ObjectCache::getMainWANInstance();
/**
* Get database id given a user name
* @param string $name Username
- * @param integer $flags User::READ_* constant bitfield
+ * @param int $flags User::READ_* constant bitfield
* @return int|null The corresponding user's ID, or null if user is nonexistent
*/
public static function idFromName( $name, $flags = self::READ_NORMAL ) {
* Load user and user_group data from the database.
* $this->mId must be set, this is how the user is identified.
*
- * @param integer $flags User::READ_* constant bitfield
+ * @param int $flags User::READ_* constant bitfield
* @return bool True if the user exists, false if the user is anonymous
*/
public function loadFromDatabase( $flags = self::READ_LATEST ) {
protected $primaryKey;
/**
- * @var integer $batchSize The number of rows to fetch per iteration
+ * @var int $batchSize The number of rows to fetch per iteration
*/
protected $batchSize;
private $current = [];
/**
- * @var integer key 0-indexed number of pages fetched since self::reset()
+ * @var int key 0-indexed number of pages fetched since self::reset()
*/
private $key;
* @param IDatabase $db The database to read from
* @param string|array $table The name or names of the table to read from
* @param string|array $primaryKey The name or names of the primary key columns
- * @param integer $batchSize The number of rows to fetch per iteration
+ * @param int $batchSize The number of rows to fetch per iteration
* @throws InvalidArgumentException
*/
public function __construct( IDatabase $db, $table, $primaryKey, $batchSize ) {
}
/**
- * @return integer 0-indexed count of the page number fetched
+ * @return int 0-indexed count of the page number fetched
*/
public function key() {
return $this->key;
/**
* @param array $time Result of UIDGenerator::millitime()
- * @param integer $delta Number of intervals to add on to the timestamp
+ * @param int $delta Number of intervals to add on to the timestamp
* @return string 60 bits of "100ns intervals since 15 October 1582" (rolls over in 3400)
* @throws RuntimeException
*/
* @param array $config Configuration options
* @param int|null $config['pushPending'] Whether the input should be visually marked as
* "pending", while requesting suggestions (default: false)
- * @param boolean|null $config['performSearchOnClick'] If true, the script will start a search
+ * @param bool|null $config['performSearchOnClick'] If true, the script will start a search
* whenever a user hits a suggestion. If false, the text of the suggestion is inserted into the
* text field only (default: true)
* @param string $config['dataLocation'] Where the search input field will be
* @param array $config Configuration options
* @param array $config['textinput'] Configuration for the TextInputWidget
* @param array $config['dropdowninput'] Configuration for the DropdownInputWidget
- * @param boolean $config['or'] Configuration for whether the widget is dropdown AND input
+ * @param bool $config['or'] Configuration for whether the widget is dropdown AND input
* or dropdown OR input
*/
public function __construct( array $config = [] ) {
*
* @since 1.28
* @param Language $lang
- * @return boolean
+ * @return bool
*/
public function equals( Language $lang ) {
return $lang->getCode() === $this->mCode;
/**
* @param string $code
- * @param boolean $fallback Whether we're going through language fallback chain
+ * @param bool $fallback Whether we're going through language fallback chain
* @return string Name of the language class
*/
public static function classFromCode( $code, $fallback = true ) {
* If not set, wfGetDB() will be used.
* This function has the same parameters as wfGetDB()
*
- * @param integer $db DB index (DB_REPLICA/DB_MASTER)
+ * @param int $db DB index (DB_REPLICA/DB_MASTER)
* @param array $groups; default: empty array
* @param string|bool $wiki; default: current wiki
* @return IMaintainableDatabase
/**
* Get the preferred destination title for a given target page.
- * @param integer $ns The destination namespace ID
+ * @param int $ns The destination namespace ID
* @param string $name The conflicting prefix
- * @param integer $sourceNs The source namespace
- * @param integer $sourceDbk The source DB key (i.e. page_title)
+ * @param int $sourceNs The source namespace
+ * @param int $sourceDbk The source DB key (i.e. page_title)
* @param array $options Associative array of validated command-line options
* @return Title|false
*/
* @ingroup Maintenance
*/
class RebuildRecentchanges extends Maintenance {
- /** @var integer UNIX timestamp */
+ /** @var int UNIX timestamp */
private $cutoffFrom;
- /** @var integer UNIX timestamp */
+ /** @var int UNIX timestamp */
private $cutoffTo;
public function __construct() {
<exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
<exclude name="MediaWiki.Commenting.FunctionComment.SpacingAfter" />
<exclude name="MediaWiki.Commenting.FunctionComment.ParamNameNoMatch" />
- <exclude name="MediaWiki.Commenting.FunctionComment.NotShortBoolReturn" />
- <exclude name="MediaWiki.Commenting.FunctionComment.NotShortIntReturn" />
- <exclude name="MediaWiki.Commenting.FunctionComment.NotShortBoolParam" />
- <exclude name="MediaWiki.Commenting.FunctionComment.NotShortIntParam" />
<exclude name="MediaWiki.Commenting.FunctionComment.ExtraParamComment" />
<exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" />
<exclude name="MediaWiki.Commenting.IllegalSingleLineComment.IllegalSingleLineCommentStart" />
* Determine whether a particular setup function has been run
*
* @param string $funcName
- * @return boolean
+ * @return bool
*/
public function isSetupDone( $funcName ) {
return isset( $this->setupDone[$funcName] ) ? $this->setupDone[$funcName] : false;
* @covers WANObjectCache::get()
* @covers WANObjectCache::makeKey()
* @param mixed $value
- * @param integer $ttl
+ * @param int $ttl
*/
public function testSetAndGet( $value, $ttl ) {
$curTTL = null;