Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
This commit is contained in:
parent
f3cc77aaee
commit
138ddc452f
20 changed files with 37 additions and 37 deletions
|
|
@ -103,7 +103,7 @@ class Category {
|
|||
* Factory function.
|
||||
*
|
||||
* @param $title Title for the category page
|
||||
* @return category|false on a totally invalid name
|
||||
* @return Category|bool on a totally invalid name
|
||||
*/
|
||||
public static function newFromTitle( $title ) {
|
||||
$cat = new self();
|
||||
|
|
@ -185,7 +185,7 @@ class Category {
|
|||
public function getFileCount() { return $this->getX( 'mFiles' ); }
|
||||
|
||||
/**
|
||||
* @return Title|false Title for this category, or false on failure.
|
||||
* @return Title|bool Title for this category, or false on failure.
|
||||
*/
|
||||
public function getTitle() {
|
||||
if ( $this->mTitle ) return $this->mTitle;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class ExternalStore {
|
|||
*
|
||||
* @param $url String: The URL of the text to get
|
||||
* @param $params Array: associative array of parameters for the ExternalStore object.
|
||||
* @return The text stored or false on error
|
||||
* @return string|bool The text stored or false on error
|
||||
*/
|
||||
static function fetchFromURL( $url, $params = array() ) {
|
||||
global $wgExternalStores;
|
||||
|
|
@ -81,7 +81,7 @@ class ExternalStore {
|
|||
* @param $url
|
||||
* @param $data
|
||||
* @param $params array
|
||||
* @return string|false The URL of the stored data item, or false on error
|
||||
* @return string|bool The URL of the stored data item, or false on error
|
||||
*/
|
||||
static function insert( $url, $data, $params = array() ) {
|
||||
list( $proto, $params ) = explode( '://', $url, 2 );
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ abstract class ExternalUser {
|
|||
* This is a wrapper around newFromId().
|
||||
*
|
||||
* @param $user User
|
||||
* @return ExternalUser|false
|
||||
* @return ExternalUser|bool
|
||||
*/
|
||||
public static function newFromUser( $user ) {
|
||||
global $wgExternalAuthType;
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class HTMLForm extends ContextSource {
|
|||
/**
|
||||
* Form action URL. false means we will use the URL to set Title
|
||||
* @since 1.19
|
||||
* @var false|string
|
||||
* @var bool|string
|
||||
*/
|
||||
protected $mAction = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -512,7 +512,7 @@ abstract class ApiBase extends ContextSource {
|
|||
|
||||
/**
|
||||
* Returns usage examples for this module. Return false if no examples are available.
|
||||
* @return false|string|array
|
||||
* @return bool|string|array
|
||||
*/
|
||||
protected function getExamples() {
|
||||
return false;
|
||||
|
|
@ -1372,7 +1372,7 @@ abstract class ApiBase extends ContextSource {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return false|string|array Returns a false if the module has no help url, else returns a (array of) string
|
||||
* @return bool|string|array Returns a false if the module has no help url, else returns a (array of) string
|
||||
*/
|
||||
public function getHelpUrls() {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ class ApiQuery extends ApiBase {
|
|||
* @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 getNamedDB( $name, $db, $groups ) {
|
||||
if ( !array_key_exists( $name, $this->mNamedDB ) ) {
|
||||
|
|
|
|||
2
includes/cache/FileCacheBase.php
vendored
2
includes/cache/FileCacheBase.php
vendored
|
|
@ -74,7 +74,7 @@ abstract class FileCacheBase {
|
|||
|
||||
/**
|
||||
* Get the last-modified timestamp of the cache file
|
||||
* @return string|false TS_MW timestamp
|
||||
* @return string|bool TS_MW timestamp
|
||||
*/
|
||||
public function cacheTimestamp() {
|
||||
$timestamp = filemtime( $this->cachePath() );
|
||||
|
|
|
|||
4
includes/cache/MessageCache.php
vendored
4
includes/cache/MessageCache.php
vendored
|
|
@ -126,7 +126,7 @@ class MessageCache {
|
|||
*
|
||||
* @param $hash String: the hash of contents, to check validity.
|
||||
* @param $code Mixed: Optional language code, see documenation of load().
|
||||
* @return false on failure.
|
||||
* @return bool on failure.
|
||||
*/
|
||||
function loadFromLocal( $hash, $code ) {
|
||||
global $wgCacheDirectory, $wgLocalMessageCacheSerialized;
|
||||
|
|
@ -520,7 +520,7 @@ class MessageCache {
|
|||
* @param $cache Array: cached messages with a version.
|
||||
* @param $memc Bool: Wether to update or not memcache.
|
||||
* @param $code String: Language code.
|
||||
* @return False on somekind of error.
|
||||
* @return bool on somekind of error.
|
||||
*/
|
||||
protected function saveToCaches( $cache, $memc = true, $code = false ) {
|
||||
wfProfileIn( __METHOD__ );
|
||||
|
|
|
|||
|
|
@ -1093,7 +1093,7 @@ abstract class DatabaseBase implements DatabaseType {
|
|||
* @param $fname string The function name of the caller.
|
||||
* @param $options string|array The query options. See DatabaseBase::select() for details.
|
||||
*
|
||||
* @return false|mixed The value from the field, or false on failure.
|
||||
* @return bool|mixed The value from the field, or false on failure.
|
||||
*/
|
||||
function selectField( $table, $var, $cond = '', $fname = 'DatabaseBase::selectField',
|
||||
$options = array() )
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ class IBM_DB2Result{
|
|||
|
||||
/**
|
||||
* Construct and initialize a wrapper for DB2 query results
|
||||
* @param $db Database
|
||||
* @param $db DatabaseBase
|
||||
* @param $result Object
|
||||
* @param $num_rows Integer
|
||||
* @param $sql String
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ class DatabaseMysql extends DatabaseBase {
|
|||
* @param $table string
|
||||
* @param $index string
|
||||
* @param $fname string
|
||||
* @return false|array
|
||||
* @return bool|array
|
||||
*/
|
||||
function indexInfo( $table, $index, $fname = 'DatabaseMysql::indexInfo' ) {
|
||||
# SHOW INDEX works in MySQL 3.23.58, but SHOW INDEXES does not.
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class DatabaseSqlite extends DatabaseBase {
|
|||
*
|
||||
* @param $fileName string
|
||||
*
|
||||
* @return PDO|false SQL connection or false if failed
|
||||
* @return PDO|bool SQL connection or false if failed
|
||||
*/
|
||||
function openFile( $fileName ) {
|
||||
$this->mDatabaseFile = $fileName;
|
||||
|
|
@ -140,7 +140,7 @@ class DatabaseSqlite extends DatabaseBase {
|
|||
|
||||
/**
|
||||
* Check if the searchindext table is FTS enabled.
|
||||
* @return false if not enabled.
|
||||
* @return bool if not enabled.
|
||||
*/
|
||||
function checkForEnabledSearch() {
|
||||
if ( self::$fulltextEnabled === null ) {
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class FSFile {
|
|||
/**
|
||||
* Get the file size in bytes
|
||||
*
|
||||
* @return int|false
|
||||
* @return int|bool
|
||||
*/
|
||||
public function getSize() {
|
||||
return filesize( $this->path );
|
||||
|
|
@ -54,7 +54,7 @@ class FSFile {
|
|||
/**
|
||||
* Get the file's last-modified timestamp
|
||||
*
|
||||
* @return string|false TS_MW timestamp or false on failure
|
||||
* @return string|bool TS_MW timestamp or false on failure
|
||||
*/
|
||||
public function getTimestamp() {
|
||||
wfSuppressWarnings();
|
||||
|
|
@ -174,7 +174,7 @@ class FSFile {
|
|||
* 160 log 2 / log 36 = 30.95, so the 160-bit hash fills 31 digits in base 36
|
||||
* fairly neatly.
|
||||
*
|
||||
* @return false|string False on failure
|
||||
* @return bool|string False on failure
|
||||
*/
|
||||
public function getSha1Base36() {
|
||||
wfProfileIn( __METHOD__ );
|
||||
|
|
@ -224,7 +224,7 @@ class FSFile {
|
|||
*
|
||||
* @param $path string
|
||||
*
|
||||
* @return false|string False on failure
|
||||
* @return bool|string False on failure
|
||||
*/
|
||||
public static function getSha1Base36FromPath( $path ) {
|
||||
$fsFile = new self( $path );
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ abstract class FileBackend {
|
|||
/**
|
||||
* Get an explanatory message if this backend is read-only
|
||||
*
|
||||
* @return string|false Returns falls if the backend is not read-only
|
||||
* @return string|bool Returns falls if the backend is not read-only
|
||||
*/
|
||||
final public function getReadOnlyReason() {
|
||||
return ( $this->readOnly != '' ) ? $this->readOnly : false;
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ class LSLockManager extends LockManager {
|
|||
* @param $action string
|
||||
* @param $type string
|
||||
* @param $values Array
|
||||
* @return string|false
|
||||
* @return string|bool
|
||||
*/
|
||||
protected function sendCommand( $lockSrv, $action, $type, $values ) {
|
||||
$conn = $this->getConnection( $lockSrv );
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class ArchivedFile {
|
|||
|
||||
/**
|
||||
* Loads a file object from the filearchive table
|
||||
* @return true on success or null
|
||||
* @return bool on success or null
|
||||
*/
|
||||
public function load() {
|
||||
if ( $this->dataLoaded ) {
|
||||
|
|
|
|||
|
|
@ -68,19 +68,19 @@ abstract class File {
|
|||
*/
|
||||
|
||||
/**
|
||||
* @var FileRepo|false
|
||||
* @var FileRepo|bool
|
||||
*/
|
||||
var $repo;
|
||||
|
||||
/**
|
||||
* @var Title|false
|
||||
* @var Title|bool
|
||||
*/
|
||||
var $title;
|
||||
|
||||
var $lastError, $redirected, $redirectedTitle;
|
||||
|
||||
/**
|
||||
* @var FSFile|false
|
||||
* @var FSFile|bool
|
||||
*/
|
||||
protected $fsFile;
|
||||
|
||||
|
|
@ -111,8 +111,8 @@ abstract class File {
|
|||
* may return false or throw exceptions if they are not set.
|
||||
* Most subclasses will want to call assertRepoDefined() here.
|
||||
*
|
||||
* @param $title Title|string|false
|
||||
* @param $repo FileRepo|false
|
||||
* @param $title Title|string|bool
|
||||
* @param $repo FileRepo|bool
|
||||
*/
|
||||
function __construct( $title, $repo ) {
|
||||
if ( $title !== false ) { // subclasses may not use MW titles
|
||||
|
|
@ -127,7 +127,7 @@ abstract class File {
|
|||
* valid Title object with namespace NS_FILE or null
|
||||
*
|
||||
* @param $title Title|string
|
||||
* @param $exception string|false Use 'exception' to throw an error on bad titles
|
||||
* @param $exception string|bool Use 'exception' to throw an error on bad titles
|
||||
* @return Title|null
|
||||
*/
|
||||
static function normalizeTitle( $title, $exception = false ) {
|
||||
|
|
@ -383,7 +383,7 @@ abstract class File {
|
|||
*
|
||||
* @param $page int
|
||||
*
|
||||
* @return false|number
|
||||
* @return bool|number
|
||||
*/
|
||||
public function getHeight( $page = 1 ) {
|
||||
return false;
|
||||
|
|
@ -1401,7 +1401,7 @@ abstract class File {
|
|||
*
|
||||
* @param $reason String
|
||||
* @param $suppress Boolean: hide content from sysops?
|
||||
* @return true on success, false on some kind of failure
|
||||
* @return bool on success, false on some kind of failure
|
||||
* STUB
|
||||
* Overridden by LocalFile
|
||||
*/
|
||||
|
|
@ -1442,7 +1442,7 @@ abstract class File {
|
|||
* Returns the number of pages of a multipage document, or false for
|
||||
* documents which aren't multipage documents
|
||||
*
|
||||
* @return false|int
|
||||
* @return bool|int
|
||||
*/
|
||||
function pageCount() {
|
||||
if ( !isset( $this->pageCount ) ) {
|
||||
|
|
@ -1618,7 +1618,7 @@ abstract class File {
|
|||
*
|
||||
* @param $path string
|
||||
*
|
||||
* @return false|string False on failure
|
||||
* @return bool|string False on failure
|
||||
*/
|
||||
static function sha1Base36( $path ) {
|
||||
wfDeprecated( __METHOD__, '1.19' );
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class UnregisteredLocalFile extends File {
|
|||
* A FileRepo object is not required here, unlike most other File classes.
|
||||
*
|
||||
* @throws MWException
|
||||
* @param $title Title|false
|
||||
* @param $title Title|bool
|
||||
* @param $repo FileRepo
|
||||
* @param $path string
|
||||
* @param $mime string
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ abstract class DatabaseInstaller {
|
|||
public abstract function getName();
|
||||
|
||||
/**
|
||||
* @return true if the client library is compiled in.
|
||||
* @return bool Returns true if the client library is compiled in.
|
||||
*/
|
||||
public abstract function isCompiled();
|
||||
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ class DoubleRedirectJob extends Job {
|
|||
*
|
||||
* @param $title Title
|
||||
*
|
||||
* @return false if the specified title is not a redirect, or if it is a circular redirect
|
||||
* @return bool if the specified title is not a redirect, or if it is a circular redirect
|
||||
*/
|
||||
public static function getFinalDestination( $title ) {
|
||||
$dbw = wfGetDB( DB_MASTER );
|
||||
|
|
|
|||
Loading…
Reference in a new issue