/**
* Constructor and clear the article
- * @param $title Reference to a Title object.
+ * @param $title Title Reference to a Title object.
* @param $oldId Integer revision ID, null to fetch from request, zero for current
*/
public function __construct( Title $title, $oldId = null ) {
* self::checkCondition for evaluation of the latter type.
*
* @param $cond Mixed: a condition, possibly containing other conditions
- * @param $user The user to check the conditions against
+ * @param $user User The user to check the conditions against
* @return bool Whether the condition is true
*/
private static function recCheckCondition( $cond, User $user ) {
* ates them.
*
* @param $cond Array: A condition, which must not contain other conditions
- * @param $user The user to check the condition against
+ * @param $user User The user to check the condition against
* @return bool Whether the condition is true for the user
*/
private static function checkCondition( $cond, User $user ) {
/**
* Set the Database object to use
+ *
+ * @param $db DatabaseBase
*/
public function setDB( $db ) {
$this->db = $db;
/**
* Check if two blocks are effectively equal. Doesn't check irrelevant things like
* the blocking user or the block timestamp, only things which affect the blocked user *
- * @return Boolean
+ *
+ * @param $block Block
+ *
+ * @return bool
*/
public function equals( Block $block ) {
return (
/**
* Get a value with a given key. Only string values are supported.
+ *
+ * @param $key string
*/
abstract public function get( $key );
}
* Store a data item to an external store, identified by a partial URL
* The protocol part is used to identify the class, the rest is passed to the
* class itself as a parameter.
- * @return The URL of the stored data item, or false on error
+ * @return string The URL of the stored data item, or false on error
*/
static function insert( $url, $data, $params = array() ) {
list( $proto, $params ) = explode( '://', $url, 2 );
*
* @param $data String
* @param $storageParams Array: associative array of parameters for the ExternalStore object.
- * @return The URL of the stored data item, or false on error
+ * @return string The URL of the stored data item, or false on error
*/
public static function insertToDefault( $data, $storageParams = array() ) {
global $wgDefaultExternalStore;
}
}
- /** Like insertToDefault, but inserts on another wiki */
+ /**
+ * @param $data
+ * @param $wiki
+ *
+ * @return string
+ */
public static function insertToForeignDefault( $data, $wiki ) {
return self::insertToDefault( $data, array( 'wiki' => $wiki ) );
}
return utf8_encode( $string );
}
return $string;
- }
-
+ }
+
/**
* Fallback implementation for mb_substr, hardcoded to UTF-8.
* Attempts to be at least _moderately_ efficient; best optimized
* Larger offsets are still fairly efficient for Latin text, but
* can be up to 100x slower than native if the text is heavily
* multibyte and we have to slog through a few hundred kb.
+ *
+ * @param $str
+ * @param $start
+ * @param $count string
+ *
+ * @return string
*/
- public static function mb_substr( $str, $start, $count='end' ) {
+ public static function mb_substr( $str, $start, $count = 'end' ) {
if( $start != 0 ) {
$split = self::mb_substr_split_unicode( $str, intval( $start ) );
$str = substr( $str, $split );
}
/**
- * Get a list of contributors of $article
- * @param $article Article object
+ * Get a list of contributors
+ *
* @param $cnt Int: maximum list of contributors to show
* @param $showIfMax Bool: whether to contributors if there more than $cnt
* @return String: html
/**
* Get the name of the module as shown in the profiler log
*
- * @param $db
+ * @param $db DatabaseBase
*
* @return string
*/
/**
* Return the API documentation for the parameters.
- * @return {Array} parameter documentation.
+ * @return Array parameter documentation.
*/
public function getParamDescription() {
$p = $this->getModulePrefix();
/**
* Validate the 'user' parameter and set the value to compare
* against `revision`.`rev_user_text`
+ *
+ * @param $user string
*/
private function prepareUsername( $user ) {
if ( !is_null( $user ) && $user !== '' ) {
* Stash the file and return the session key
* Also re-raises exceptions with slightly more informative message strings (useful for API)
* @throws MWException
- * @return {String} session key
+ * @return String session key
*/
function performStash() {
try {
* Partition the current range given by $this->mStart and $this->mEnd,
* using a pre-calculated title array which gives the links in that range.
* Queue the resulting jobs.
+ *
+ * @param $titleArray array
*/
protected function insertJobsFromTitles( $titleArray ) {
# We make subpartitions in the sense that the start of the first job
* Use ->setCaller( __METHOD__ ) to indicate which code is using this
* class. Only used in debugging output.
* @since 1.17
+ *
+ * @param $caller
*/
public function setCaller( $caller ) {
$this->caller = $caller;
}
/**
- * @param $title Title
- * @return void
+ * @param $title Title
*/
public function addObj( $title ) {
if ( is_object( $title ) ) {
/**
* General accessor to get/set whether SELECT FOR UPDATE should be used
+ *
+ * @return bool
*/
public function forUpdate( $update = null ) {
return wfSetVar( $this->mForUpdate, $update );
}
+ /**
+ * @param $title
+ * @return array|int
+ */
public function getGoodLinkID( $title ) {
if ( array_key_exists( $title, $this->mGoodLinks ) ) {
return $this->mGoodLinks[$title];
}
}
+ /**
+ * @param $title
+ * @return bool
+ */
public function isBadLink( $title ) {
return array_key_exists( $title, $this->mBadLinks );
}
/**
* @see Conf::writeSetting()
+ *
+ * @param $name
+ * @param $value
+ *
+ * @return bool
*/
protected function writeSetting( $name, $value ) {
$dbw = wfGetDB( DB_MASTER );
/**
* Constructor.
* Parameters $server, $user and $password are not used.
+ * @param $server string
+ * @param $user string
+ * @param $password string
+ * @param $dbName string
+ * @param $flags int
*/
function __construct( $server = false, $user = false, $password = false, $dbName = false, $flags = 0 ) {
$this->mName = $dbName;
/** Open an SQLite database and return a resource handle to it
* NOTE: only $dbName is used, the other parameters are irrelevant for SQLite databases
+ *
+ * @param $server
+ * @param $user
+ * @param $pass
+ * @param $dbName
+ *
+ * @return PDO
*/
function open( $server, $user, $pass, $dbName ) {
global $wgSQLiteDataDir;
*
* @param $cluster String: external storage cluster, or false for core
* @param $wiki String: wiki ID, or false for the current wiki
+ *
+ * @return LoadBalancer
*/
abstract function newExternalLB( $cluster, $wiki = false );
*
* @param $cluster String: external storage cluster, or false for core
* @param $wiki String: wiki ID, or false for the current wiki
+ *
+ * @return LoadBalancer
*/
abstract function &getExternalLB( $cluster, $wiki = false );
}
/**
- * @param $wiki
+ * @param $wiki string
* @return LoadBalancer
*/
function newMainLB( $wiki = false ) {
}
/**
+ *
+ * @param $server
+ * @param $dbNameOverride
+ *
* @return DatabaseBase
*/
function reallyOpenConnection( $server, $dbNameOverride = false ) {
/**
* Get lag time for each server
* Results are cached for a short time in memcached, and indefinitely in the process cache
+ *
+ * @param $wiki
+ *
+ * @return array
*/
function getLagTimes( $wiki = false ) {
# Try process cache
/**
* Return an estimate of replication lag for each server
+ *
+ * @param $serverIndexes
+ * @param $wiki
+ *
+ * @return array
*/
function getLagTimes( $serverIndexes, $wiki );
}
/**
* Determine if a string is an mwrepo:// URL
+ *
+ * @param $url string
+ *
+ * @return bool
*/
static function isVirtualUrl( $url ) {
return substr( $url, 0, 9 ) == 'mwrepo://';
* version control should return false if the time is specified.
*
* @param $title Mixed: Title object or string
- * @param $options Associative array of options:
+ * @param $options array Associative array of options:
* time: requested time for an archived image, or false for the
* current version. An image object will be returned which was
* created at the specified time.
* private: If true, return restricted (deleted) files if the current
* user is allowed to view them. Otherwise, such files will not
* be found.
+ *
+ * @return File|false
*/
function findFile( $title, $options = array() ) {
$time = isset( $options['time'] ) ? $options['time'] : false;
/**
* Per docs in FileRepo, this needs to return false if we don't support versioned
* files. Well, we don't.
+ *
+ * @return File
*/
function newFile( $title, $time = false ) {
if ( $time ) {
return parent::newFile( $title, $time );
}
-/**
- * No-ops
- */
+ /**
+ * No-ops
+ */
+
function storeBatch( $triplets, $flags = 0 ) {
return false;
}
+
function storeTemp( $originalName, $srcPath ) {
return false;
}
+
function append( $srcPath, $toAppendPath, $flags = 0 ){
return false;
}
+
function appendFinish( $toAppendPath ){
return false;
}
+
function publishBatch( $triplets, $flags = 0 ) {
return false;
}
+
function deleteBatch( $sourceDestPairs ) {
return false;
}