* @param $action String
* @param $page Page
* @param $context IContextSource
- * @return Action|false|null false if the action is disabled, null
+ * @return Action|bool|null false if the action is disabled, null
* if it is not recognised
*/
public final static function factory( $action, Page $page, IContextSource $context = null ) {
* This function has side effects! Do not use this function if you
* only want the real revision text if any.
*
- * @return Return the text of this revision
+ * @return string Return the text of this revision
*/
public function getContent() {
global $wgUser;
/**
* Get parser options suitable for rendering the primary article wikitext
- * @return ParserOptions|false
+ * @return ParserOptions|bool
*/
public function getParserOptions() {
global $wgUser;
*
* Does not return groups the user already belongs to or has once belonged.
*
- * @param $user The user to get the groups for
+ * @param $user User The user to get the groups for
* @param $event String key in $wgAutopromoteOnce (each one has groups/criteria)
*
* @return array Groups the user should be promoted to.
/**
* Get the slave connection to the database
* When non existing, will initialize the connection.
- * @return Database object
+ * @return DatabaseBase object
*/
protected function getDB() {
if ( !isset( $this->db ) ) {
* Encode expiry for DB
*
* @param $expiry String: timestamp for expiry, or
- * @param $db Database object
+ * @param $db DatabaseBase object
* @return String
* @deprecated since 1.18; use $dbw->encodeExpiry() instead
*/
*
* @param $text string
*
- * @return string|false matching string or false
+ * @return string|bool matching string or false
*/
public static function matchSpamRegex( $text ) {
global $wgSpamRegex;
*
* @parma $text string
*
- * @return string|false matching string or false
+ * @return string|bool matching string or false
*/
public static function matchSummarySpamRegex( $text ) {
global $wgSummarySpamRegex;
* Throws a warning that $function is deprecated
*
* @param $function String
- * @param $version String|false: Added in 1.19.
- * @param $component String|false: Added in 1.19.
+ * @param $version String|bool: Added in 1.19.
+ * @param $component String|bool: Added in 1.19.
*
* @return null
*/
* Shortcut for RepoGroup::singleton()->findFile()
*
* @param $title String or Title object
- * @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.
* because php might make it negative.
*
* @throws MWException if $data not long enough, or if unpack fails
- * @return Associative array of the extracted data
+ * @return array Associative array of the extracted data
*/
function wfUnpack( $format, $data, $length=false ) {
if ( $length !== false ) {
var $mOldId, $mHash, $mRef;
/**
- * @param $hash Strng: the content hash of the text
- * @param $oldid Integer: the old_id for the CGZ object
+ * @param $hash string the content hash of the text
+ * @param $oldid Integer the old_id for the CGZ object
*/
function __construct( $hash = '', $oldid = 0 ) {
$this->mHash = $hash;
}
/**
- * @return string|false
+ * @return string|bool
*/
function getText() {
$dbr = wfGetDB( DB_SLAVE );
/**
* Print the history page for an article.
- * @return nothing
*/
function onView() {
global $wgScript, $wgUseFileCache, $wgSquidMaxage;
$feedType = $request->getVal( 'feed' );
if ( $feedType ) {
wfProfileOut( __METHOD__ );
- return $this->feed( $feedType );
+ $this->feed( $feedType );
+ return;
}
// Fail nicely if article doesn't exist.
/**
* Populate this PageSet from a rowset returned from the database
- * @param $db Database object
+ * @param $db DatabaseBase object
* @param $queryResult ResultWrapper Query result object
*/
public function populateFromQueryResult( $db, $queryResult ) {
/**
* Gets a default slave database connection object
- * @return Database
+ * @return DatabaseBase
*/
public function getDB() {
if ( !isset( $this->mSlaveDB ) ) {
* @param $name string Name to assign to the database connection
* @param $db int One of the DB_* constants
* @param $groups array Query groups
- * @return Database
+ * @return DatabaseBase
*/
public function selectNamedDB( $name, $db, $groups ) {
$this->mDb = $this->getQuery()->getNamedDB( $name, $db, $groups );
* @param $title String: Message cache key with initial uppercase letter.
* @param $code String: code denoting the language to try.
*
- * @return string|false
+ * @return string|bool
*/
function getMsgFromNamespace( $title, $code ) {
global $wgAdaptiveMessageCache;
*
* @param $sql String SQL query we will append the limit too
* @param $limit Integer the SQL limit
- * @param $offset Integer|false the SQL offset (default false)
+ * @param $offset Integer|bool the SQL offset (default false)
*
* @return string
*/
* installations. Most callers should use LoadBalancer::safeGetLag()
* instead.
*
- * @return Database replication lag in seconds
+ * @return int Database replication lag in seconds
*/
function getLag() {
return intval( $this->mFakeSlaveLag );
* ones in $GLOBALS. If an array is set here, $GLOBALS will not be used at
* all. If it's set to false, $GLOBALS will be used.
*
- * @param $vars False, or array mapping variable name to value.
+ * @param $vars bool|array mapping variable name to value.
*/
function setSchemaVars( $vars ) {
$this->mSchemaVars = $vars;
* @param $user String
* @param $password String
* @param $dbName String: database name
- * @return a fresh connection
+ * @return DatabaseBase a fresh connection
*/
public function open( $server, $user, $password, $dbName ) {
wfProfileIn( __METHOD__ );
* @param $conds Array or string, condition(s) for WHERE
* @param $fname String: calling function name (use __METHOD__)
* for logs/profiling
- * @param $options Associative array of options
+ * @param $options array Associative array of options
* (e.g. array( 'GROUP BY' => 'page_title' )),
* see Database::makeSelectOptions code for list of
* supported stuff
- * @param $join_conds Associative array of table join conditions (optional)
+ * @param $join_conds array Associative array of table join conditions (optional)
* (e.g. array( 'page' => array('LEFT JOIN',
* 'page_latest=rev_id') )
* @return Mixed: database result resource for fetch functions or false
*
* @private
*
- * @param $options Associative array of options to be turned into
+ * @param $options array Associative array of options to be turned into
* an SQL query, valid keys are listed in the function.
* @return Array
*/
/**
* Get the position of the master from SHOW SLAVE STATUS
*
- * @return MySQLMasterPos|false
+ * @return MySQLMasterPos|bool
*/
function getSlavePos() {
if ( !is_null( $this->mFakeSlaveLag ) ) {
/**
* Get the position of the master from SHOW MASTER STATUS
*
- * @return MySQLMasterPos|false
+ * @return MySQLMasterPos|bool
*/
function getMasterPos() {
if ( $this->mFakeMaster ) {
* Get information about a given field
* Returns false if the field does not exist.
*
- * @return SQLiteField|false
+ * @return SQLiteField|bool
*/
function fieldInfo( $table, $field ) {
$tableName = $this->tableName( $table );
* Returns false if there is no connection open
*
* @param $i int
- * @return DatabaseBase|false
+ * @return DatabaseBase|bool
*/
function getAnyOpenConnection( $i ) {
foreach ( $this->mConns as $conns ) {
* 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
+ * @return File|bool
*/
public function findFile( $title, $options = array() ) {
$title = File::normalizeTitle( $title );
* version control should return false if the time is specified.
*
* @param $sha1 String base 36 SHA-1 hash
- * @param $options Option array, same as findFile().
- * @return File|false
+ * @param $options array Option array, same as findFile().
+ * @return File|bool
*/
public function findFileFromKey( $sha1, $options = array() ) {
$time = isset( $options['time'] ) ? $options['time'] : false;
/**
* Get the public root URL of the repository
*
- * @return string|false
+ * @return string|bool
*/
public function getRootUrl() {
return $this->url;
*
* @param $query mixed Query string to append
* @param $entry string Entry point; defaults to index
- * @return string|false
+ * @return string|bool
*/
public function makeUrl( $query = '', $entry = 'index' ) {
if ( isset( $this->scriptDirUrl ) ) {
/**
* Get the URL of the stylesheet to apply to description pages
*
- * @return string|false
+ * @return string|bool
*/
public function getDescriptionStylesheetUrl() {
if ( isset( $this->scriptDirUrl ) ) {
* Get the timestamp of a file with a given virtual URL/storage path
*
* @param $virtualUrl string
- * @return string|false
+ * @return string|bool
*/
public function getFileTimestamp( $virtualUrl ) {
$path = $this->resolveToStoragePath( $virtualUrl );
* Get the sha1 of a file with a given virtual URL/storage path
*
* @param $virtualUrl string
- * @return string|false
+ * @return string|bool
*/
public function getFileSha1( $virtualUrl ) {
$path = $this->resolveToStoragePath( $virtualUrl );
/**
* Construct a group of file repositories.
*
- * @param $localInfo Associative array for local repo's info
+ * @param $localInfo array Associative array for local repo's info
* @param $foreignInfo Array of repository info arrays.
* Each info array is an associative array with the 'class' member
* giving the class name. The entire array is passed to the repository
* latest : use the latest available data
*
* @param $params Array
- * @return string|false TS_MW timestamp or false on failure
+ * @return string|bool TS_MW timestamp or false on failure
*/
abstract public function getFileTimestamp( array $params );
* latest : use the latest available data
*
* @param $params Array
- * @return string|false Returns false on failure
+ * @return string|bool Returns false on failure
*/
abstract public function getFileContents( array $params );
* latest : use the latest available data
*
* @param $params Array
- * @return integer|false Returns false on failure
+ * @return integer|bool Returns false on failure
*/
abstract public function getFileSize( array $params );
* latest : use the latest available data
*
* @param $params Array
- * @return Array|false|null Returns null on failure
+ * @return Array|bool|null Returns null on failure
*/
abstract public function getFileStat( array $params );
* latest : use the latest available data
*
* @param $params Array
- * @return string|false Hash string or false on failure
+ * @return string|bool Hash string or false on failure
*/
abstract public function getFileSha1Base36( array $params );
* precheckDestExistence() helper function to get the source file SHA-1.
* Subclasses should overwride this iff the source is not in storage.
*
- * @return string|false Returns false on failure
+ * @return string|bool Returns false on failure
*/
protected function getSourceSha1Base36() {
return null; // N/A
*
* @param $source string Storage path
* @param $predicates Array
- * @return string|false
+ * @return string|bool
*/
final protected function fileSha1( $source, array $predicates ) {
if ( isset( $predicates['sha1'][$source] ) ) {
/**
* Get a connection to the Swift proxy
*
- * @return CF_Connection|false
+ * @return CF_Connection|bool
* @throws InvalidResponseException
*/
protected function getConnection() {
* Get (or reuse) a connection to a lock DB
*
* @param $lockDb string
- * @return Database
+ * @return DatabaseBase
* @throws DBError
*/
protected function getConnection( $lockDb ) {
/**
* Return the associated title object
*
- * @return Title|false
+ * @return Title|bool
*/
public function getTitle() {
return $this->title;
* Most callers don't check the return value, but ForeignAPIFile::getPath
* returns false.
*
- * @return string|false
+ * @return string|bool
*/
public function getPath() {
if ( !isset( $this->path ) ) {
* Returns false on failure. Callers must not alter the file.
* Temporary files are cleared automatically.
*
- * @return string|false
+ * @return string|bool
*/
public function getLocalRefPath() {
$this->assertRepoDefined();
* @param $params Array: an associative array of handler-specific parameters.
* Typical keys are width, height and page.
* @param $flags Integer: a bitfield, may contain self::RENDER_NOW to force rendering
- * @return MediaTransformOutput|false
+ * @return MediaTransformOutput|bool
*/
function transform( $params, $flags = 0 ) {
global $wgUseSquid, $wgIgnoreImageErrors, $wgThumbnailEpoch;
/**
* Returns the repository
*
- * @return FileRepo|false
+ * @return FileRepo|bool
*/
function getRepo() {
return $this->repo;
* @param $versions array set of record ids of deleted items to restore,
* or empty to restore all revisions.
* @param $unsuppress bool remove restrictions on content upon restoration?
- * @return int|false the number of file revisions restored if successful,
+ * @return int|bool the number of file revisions restored if successful,
* or false on failure
* STUB
* Overridden by LocalFile
/**
* Get the 14-character timestamp of the file upload
*
- * @return string|false TS_MW timestamp or false on failure
+ * @return string|bool TS_MW timestamp or false on failure
*/
function getTimestamp() {
$this->assertRepoDefined();
/**
* Get all thumbnail names previously generated for this file
- * @param $archiveName string|false Name of an archive file
+ * @param $archiveName string|bool Name of an archive file
* @return array first element is the base dir, then files in that base dir.
*/
function getThumbnails( $archiveName = false ) {