Fixing some of the "@return true" or "@return false", need to be "@return bool" and...
authorSam Reed <reedy@users.mediawiki.org>
Thu, 9 Feb 2012 17:42:35 +0000 (17:42 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 9 Feb 2012 17:42:35 +0000 (17:42 +0000)
Other documentation improvements

20 files changed:
includes/Category.php
includes/ExternalStore.php
includes/ExternalUser.php
includes/HTMLForm.php
includes/api/ApiBase.php
includes/api/ApiQuery.php
includes/cache/FileCacheBase.php
includes/cache/MessageCache.php
includes/db/Database.php
includes/db/DatabaseIbm_db2.php
includes/db/DatabaseMysql.php
includes/db/DatabaseSqlite.php
includes/filerepo/backend/FSFile.php
includes/filerepo/backend/FileBackend.php
includes/filerepo/backend/lockmanager/LSLockManager.php
includes/filerepo/file/ArchivedFile.php
includes/filerepo/file/File.php
includes/filerepo/file/UnregisteredLocalFile.php
includes/installer/DatabaseInstaller.php
includes/job/DoubleRedirectJob.php

index 9d9b5a6..c51a7c4 100644 (file)
@@ -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;
index 3bee6ed..f2eed4b 100644 (file)
@@ -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 );
index 3771639..49d525f 100644 (file)
@@ -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;
index 7326bf5..a5ff8cd 100644 (file)
@@ -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;
 
index e67ac05..5a7ae26 100644 (file)
@@ -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;
index cd54a7d..5a98ecf 100644 (file)
@@ -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 ) ) {
index 3740165..70bb221 100644 (file)
@@ -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() );
index 6b53db0..78342f5 100644 (file)
@@ -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__ );
index 29523b3..2c9a128 100644 (file)
@@ -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() )
index fed3b12..7aefd59 100644 (file)
@@ -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
index c179b72..a23d9cd 100644 (file)
@@ -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.
index b2eb1c6..d266125 100644 (file)
@@ -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 ) {
index 54dd135..5d2bb52 100644 (file)
@@ -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 );
index f44066f..f1e8c84 100644 (file)
@@ -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;
index b7ac743..c1b741f 100644 (file)
@@ -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 );
index 3b9bd7f..2b43273 100644 (file)
@@ -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 ) {
index f74fb67..0be67e0 100644 (file)
@@ -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' );
index cd9d3d0..7c5eab0 100644 (file)
@@ -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
index b086478..33327ef 100644 (file)
@@ -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();
 
index 2b7cd7c..2a14445 100644 (file)
@@ -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 );