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 19:30:01 +0000 (19:30 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 9 Feb 2012 19:30:01 +0000 (19:30 +0000)
Other documentation improvements

26 files changed:
includes/ChangesFeed.php
includes/ChangesList.php
includes/Collation.php
includes/EditPage.php
includes/FormOptions.php
includes/GlobalFunctions.php
includes/HTMLForm.php
includes/Hooks.php
includes/ImageGallery.php
includes/Import.php
includes/api/ApiDelete.php
includes/api/ApiQueryRecentChanges.php
includes/cache/MessageCache.php
includes/db/Database.php
includes/db/DatabaseIbm_db2.php
includes/db/DatabaseMysql.php
includes/db/DatabaseSqlite.php
includes/diff/DairikiDiff.php
includes/filerepo/FileRepo.php
includes/filerepo/RepoGroup.php
includes/filerepo/file/File.php
includes/filerepo/file/LocalFile.php
includes/installer/SqliteInstaller.php
includes/installer/WebInstallerPage.php
includes/libs/CSSJanus.php
includes/libs/IEUrlExtension.php

index bcedf2f..fa2188e 100644 (file)
@@ -107,7 +107,7 @@ class ChangesFeed {
         * @param $lastmod Integer: timestamp of the last item in the recentchanges table
         * @param $timekey String: memcached key of the last modification
         * @param $key String: memcached key of the content
-        * @return feed's content on cache hit or false on cache miss
+        * @return string|bool feed's content on cache hit or false on cache miss
         */
        public function loadFromCache( $lastmod, $timekey, $key ) {
                global $wgFeedCacheTimeout, $wgOut, $messageMemc;
index b10e775..ff07969 100644 (file)
@@ -63,7 +63,7 @@ class ChangesList extends ContextSource {
         * This first argument used to be an User object.
         *
         * @deprecated in 1.18; use newFromContext() instead
-        * @param $unused Unused
+        * @param $unused
         * @return ChangesList|EnhancedChangesList|OldChangesList derivative
         */
        public static function newFromUser( $unused ) {
index 0c510b7..e4ffae6 100644 (file)
@@ -311,7 +311,7 @@ class IcuCollation extends Collation {
         *     -1, 0 or 1 in the style of strcmp().
         * @param $target string The target value to find.
         *
-        * @return The item index of the lower bound, or false if the target value
+        * @return int|bool The item index of the lower bound, or false if the target value
         *     sorts before all items.
         */
        function findLowerBound( $valueCallback, $valueCount, $comparisonCallback, $target ) {
index dc671a6..466b8df 100644 (file)
@@ -2182,7 +2182,7 @@ HTML
         * The $textoverride method can be used by subclasses overriding showContentForm
         * to pass back to this method.
         *
-        * @param $customAttribs An array of html attributes to use in the textarea
+        * @param $customAttribs array of html attributes to use in the textarea
         * @param $textoverride String: optional text to override $this->textarea1 with
         */
        protected function showTextbox1( $customAttribs = null, $textoverride = null ) {
@@ -2817,7 +2817,7 @@ HTML
         * Returns an array of html code of the following checkboxes:
         * minor and watch
         *
-        * @param $tabindex Current tabindex
+        * @param $tabindex int Current tabindex
         * @param $checked Array of checkbox => bool, where bool indicates the checked
         *                 status of the checkbox
         *
@@ -2868,7 +2868,7 @@ HTML
         * Returns an array of html code of the following buttons:
         * save, diff, preview and live
         *
-        * @param $tabindex Current tabindex
+        * @param $tabindex int Current tabindex
         *
         * @return array
         */
@@ -2997,7 +2997,7 @@ HTML
        /**
         * Produce the stock "your edit contains spam" page
         *
-        * @param $match Text which triggered one or more filters
+        * @param $match string Text which triggered one or more filters
         * @deprecated since 1.17 Use method spamPageWithContent() instead
         */
        static function spamPage( $match = false ) {
@@ -3020,7 +3020,7 @@ HTML
        /**
         * Show "your edit contains spam" page with your diff and text
         *
-        * @param $match Text which triggered one or more filters
+        * @param $match string|bool Text which triggered one or more filters
         */
        public function spamPageWithContent( $match = false ) {
                global $wgOut;
index ccc87d8..50068fc 100644 (file)
@@ -65,7 +65,7 @@ class FormOptions implements ArrayAccess {
         *
         * @param $data Mixed: value to guess type for
         * @exception MWException Unsupported datatype
-        * @return Type constant 
+        * @return int Type constant
         */
        public static function guessType( $data ) {
                if ( is_bool( $data ) ) {
index b6e74b7..7ef6f32 100644 (file)
@@ -1768,7 +1768,7 @@ function wfGetCaller( $level = 2 ) {
  * Return a string consisting of callers in the stack. Useful sometimes
  * for profiling specific points.
  *
- * @param $limit The maximum depth of the stack frame to return, or false for
+ * @param $limit int The maximum depth of the stack frame to return, or false for
  *               the entire stack.
  * @return String
  */
@@ -1977,7 +1977,7 @@ function wfSetBit( &$dest, $bit, $state = true ) {
  * A wrapper around the PHP function var_export().
  * Either print it or add it to the regular output ($wgOut).
  *
- * @param $var A PHP variable to dump.
+ * @param $var mixed A PHP variable to dump.
  */
 function wfVarDump( $var ) {
        global $wgOut;
@@ -2749,11 +2749,11 @@ function wfEscapeShellArg( ) {
  * Execute a shell command, with time and memory limits mirrored from the PHP
  * configuration if supported.
  * @param $cmd String Command line, properly escaped for shell.
- * @param &$retval optional, will receive the program's exit code.
+ * @param &$retval null|Mixed optional, will receive the program's exit code.
  *                 (non-zero is usually failure)
  * @param $environ Array optional environment variables which should be
  *                 added to the executed command environment.
- * @return collected stdout as a string (trailing newlines stripped)
+ * @return string collected stdout as a string (trailing newlines stripped)
  */
 function wfShellExec( $cmd, &$retval = null, $environ = array() ) {
        global $IP, $wgMaxShellMemory, $wgMaxShellFileSize, $wgMaxShellTime;
@@ -3513,7 +3513,7 @@ function wfScript( $script = 'index' ) {
 /**
  * Get the script URL.
  *
- * @return script URL
+ * @return string script URL
  */
 function wfGetScriptUrl() {
        if( isset( $_SERVER['SCRIPT_NAME'] ) ) {
index 678babc..ad34909 100644 (file)
@@ -664,7 +664,7 @@ class HTMLForm extends ContextSource {
 
        /**
         * Get the text for the submit button, either customised or a default.
-        * @return unknown_type
+        * @return
         */
        function getSubmitText() {
                return $this->mSubmitText
@@ -852,7 +852,7 @@ class HTMLForm extends ContextSource {
         * to the form as a whole, after it's submitted but before it's
         * processed.
         * @param $data
-        * @return unknown_type
+        * @return
         */
        function filterDataForSubmit( $data ) {
                return $data;
index e1c1d50..54c18fd 100644 (file)
@@ -259,7 +259,7 @@ class Hooks {
        /**
         * This REALLY should be protected... but it's public for compatibility
         *
-        * @param $errno Unused
+        * @param $errno
         * @param $errstr String: error message
         * @return Boolean: false
         */
index 1106124..a3c6e0d 100644 (file)
@@ -75,7 +75,7 @@ class ImageGallery {
        /**
         * Set the caption (as plain text)
         *
-        * @param $caption Caption
+        * @param $caption string Caption
         */
        function setCaption( $caption ) {
                $this->mCaption = htmlspecialchars( $caption );
index e906c7f..d53810b 100644 (file)
@@ -301,7 +301,8 @@ class WikiImporter {
 
        /**
         * Notify the callback function of a revision
-        * @param $revision A WikiRevision object
+        * @param $revision |WikiRevision object
+        * @return bool|mixed
         */
        private function revisionCallback( $revision ) {
                if ( isset( $this->mRevisionCallback ) ) {
@@ -314,7 +315,8 @@ class WikiImporter {
 
        /**
         * Notify the callback function of a new log item
-        * @param $revision A WikiRevision object
+        * @param $revision WikiRevision object
+        * @return bool|mixed
         */
        private function logItemCallback( $revision ) {
                if ( isset( $this->mLogItemCallback ) ) {
index cfaf6cc..8a4a17f 100644 (file)
@@ -145,7 +145,7 @@ class ApiDelete extends ApiBase {
         * @param $oldimage
         * @param $reason
         * @param $suppress bool
-        * @return \type|array|Title
+        * @return array|Title
         */
        public static function deleteFile( Page $page, User $user, $token, $oldimage, &$reason = null, $suppress = false ) {
                $title = $page->getTitle();
index bf5bbd9..7ddf670 100644 (file)
@@ -304,7 +304,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase {
         * Extracts from a single sql row the data needed to describe one recent change.
         *
         * @param $row The row from which to extract the data.
-        * @return An array mapping strings (descriptors) to their respective string values.
+        * @return array An array mapping strings (descriptors) to their respective string values.
         * @access public
         */
        public function extractRowInfo( $row ) {
index f916503..8893373 100644 (file)
@@ -588,7 +588,7 @@ class MessageCache {
         * @param $isFullKey Boolean: specifies whether $key is a two part key
         *                   "msg/lang".
         *
-        * @return string|false
+        * @return string|bool
         */
        function get( $key, $useDB = true, $langcode = true, $isFullKey = false ) {
                global $wgLanguageCode, $wgContLang;
index ab9e2f4..205409f 100644 (file)
@@ -253,7 +253,7 @@ abstract class DatabaseBase implements DatabaseType {
         *   - false to disable debugging
         *   - omitted or null to do nothing
         *
-        * @return The previous value of the flag
+        * @return bool|null previous value of the flag
         */
        function debug( $debug = null ) {
                return wfSetBit( $this->mFlags, DBO_DEBUG, $debug );
@@ -279,7 +279,7 @@ abstract class DatabaseBase implements DatabaseType {
         *
         * @param $buffer null|bool
         *
-        * @return The previous value of the flag
+        * @return null|bool The previous value of the flag
         */
        function bufferResults( $buffer = null ) {
                if ( is_null( $buffer ) ) {
@@ -310,8 +310,8 @@ abstract class DatabaseBase implements DatabaseType {
         * Historically, transactions were allowed to be "nested". This is no
         * longer supported, so this function really only returns a boolean.
         *
-        * @param $level An integer (0 or 1), or omitted to leave it unchanged.
-        * @return The previous value
+        * @param $level int An integer (0 or 1), or omitted to leave it unchanged.
+        * @return int The previous value
         */
        function trxLevel( $level = null ) {
                return wfSetVar( $this->mTrxLevel, $level );
@@ -319,8 +319,8 @@ abstract class DatabaseBase implements DatabaseType {
 
        /**
         * Get/set the number of errors logged. Only useful when errors are ignored
-        * @param $count The count to set, or omitted to leave it unchanged.
-        * @return The error count
+        * @param $count int The count to set, or omitted to leave it unchanged.
+        * @return int The error count
         */
        function errorCount( $count = null ) {
                return wfSetVar( $this->mErrorCount, $count );
@@ -328,8 +328,8 @@ abstract class DatabaseBase implements DatabaseType {
 
        /**
         * Get/set the table prefix.
-        * @param $prefix The table prefix to set, or omitted to leave it unchanged.
-        * @return The previous table prefix.
+        * @param $prefix string The table prefix to set, or omitted to leave it unchanged.
+        * @return string The previous table prefix.
         */
        function tablePrefix( $prefix = null ) {
                return wfSetVar( $this->mTablePrefix, $prefix );
@@ -1371,7 +1371,7 @@ abstract class DatabaseBase implements DatabaseType {
         * @param $options string|array Query options
         * @param $join_conds string|array Join conditions
         *
-        * @return SQL query string.
+        * @return string SQL query string.
         * @see DatabaseBase::select()
         */
        function selectSQLText( $table, $vars, $conds = '', $fname = 'DatabaseBase::select', $options = array(), $join_conds = array() ) {
@@ -2789,7 +2789,7 @@ abstract class DatabaseBase implements DatabaseType {
         * @param $timeout Integer: the maximum number of seconds to wait for
         *   synchronisation
         *
-        * @return An integer: zero if the slave was past that position already,
+        * @return integer: zero if the slave was past that position already,
         *   greater than zero if we waited for some period of time, less than
         *   zero if we timed out.
         */
@@ -2909,7 +2909,7 @@ abstract class DatabaseBase implements DatabaseType {
        /**
         * List all tables on the database
         *
-        * @param $prefix Only show tables with this prefix, e.g. mw_
+        * @param $prefix string Only show tables with this prefix, e.g. mw_
         * @param $fname String: calling function name
         */
        function listTables( $prefix = null, $fname = 'DatabaseBase::listTables' ) {
@@ -3351,7 +3351,7 @@ abstract class DatabaseBase implements DatabaseType {
         * @param $lockName String: Name of lock to release
         * @param $method String: Name of method calling us
         *
-        * @return Returns 1 if the lock was released, 0 if the lock was not established
+        * @return int Returns 1 if the lock was released, 0 if the lock was not established
         * by this thread (in which case the lock is not released), and NULL if the named
         * lock did not exist
         */
index 03dbac9..613e348 100644 (file)
@@ -667,7 +667,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
         * Fields can be retrieved with $row->fieldname, with fields acting like
         * member variables.
         *
-        * @param $res SQL result object as returned from Database::query(), etc.
+        * @param $res array|ResultWrapper SQL result object as returned from Database::query(), etc.
         * @return DB2 row object
         * @throws DBUnexpectedError Thrown if the database returns an error
         */
@@ -689,8 +689,8 @@ class DatabaseIbm_db2 extends DatabaseBase {
         * Fetch the next row from the given result object, in associative array
         * form. Fields are retrieved with $row['fieldname'].
         *
-        * @param $res SQL result object as returned from Database::query(), etc.
-        * @return DB2 row object
+        * @param $res array|ResultWrapper SQL result object as returned from Database::query(), etc.
+        * @return ResultWrapper row object
         * @throws DBUnexpectedError Thrown if the database returns an error
         */
        public function fetchRow( $res ) {
@@ -715,7 +715,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
         * Doesn't escape numbers
         *
         * @param $s String: string to escape
-        * @return escaped string
+        * @return string escaped string
         */
        public function addQuotes( $s ) {
                //$this->installPrint( "DB2::addQuotes( $s )\n" );
@@ -758,7 +758,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
        /**
         * Alias for addQuotes()
         * @param $s String: string to escape
-        * @return escaped string
+        * @return string escaped string
         */
        public function strencode( $s ) {
                // Bloody useless function
@@ -904,7 +904,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
        /**
         * Generates a timestamp in an insertable format
         *
-        * @param $ts timestamp
+        * @param $ts string timestamp
         * @return String: timestamp value
         */
        public function timestamp( $ts = 0 ) {
@@ -915,7 +915,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
        /**
         * Return the next in a sequence, save the value for retrieval via insertId()
         * @param $seqName String: name of a defined sequence in the database
-        * @return next value in that sequence
+        * @return int next value in that sequence
         */
        public function nextSequenceValue( $seqName ) {
                // Not using sequences in the primary schema to allow for easier migration
@@ -934,7 +934,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
 
        /**
         * This must be called after nextSequenceVal
-        * @return Last sequence value used as a primary key
+        * @return int Last sequence value used as a primary key
         */
        public function insertId() {
                return $this->mInsertId;
@@ -1121,11 +1121,11 @@ class DatabaseIbm_db2 extends DatabaseBase {
         * UPDATE wrapper, takes a condition array and a SET array
         *
         * @param $table  String: The table to UPDATE
-        * @param $values An array of values to SET
-        * @param $conds  An array of conditions ( WHERE ). Use '*' to update all rows.
+        * @param $values array An array of values to SET
+        * @param $conds  array An array of conditions ( WHERE ). Use '*' to update all rows.
         * @param $fname  String: The Class::Function calling this function
         *                ( for the log )
-        * @param $options An array of UPDATE options, can be one or
+        * @param $options array An array of UPDATE options, can be one or
         *                 more of IGNORE, LOW_PRIORITY
         * @return Boolean
         */
@@ -1206,7 +1206,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
         * Moves the row pointer of the result set
         * @param $res Object: result set
         * @param $row Integer: row number
-        * @return success or failure
+        * @return bool success or failure
         */
        public function dataSeek( $res, $row ) {
                if ( $res instanceof ResultWrapper ) {
@@ -1502,7 +1502,7 @@ SQL;
         * Verifies that an index was created as unique
         * @param $table String: table name
         * @param $index String: index name
-        * @param $fname function name for profiling
+        * @param $fname string function name for profiling
         * @return Bool
         */
        public function indexUnique ( $table, $index,
index 6b5b6bc..86681fc 100644 (file)
@@ -860,7 +860,7 @@ class DatabaseMysql extends DatabaseBase {
        /**
         * List all tables on the database
         *
-        * @param $prefix Only show tables with this prefix, e.g. mw_
+        * @param $prefix string Only show tables with this prefix, e.g. mw_
         * @param $fname String: calling function name
         * @return array
         */
index 23c7a6b..fb0e499 100644 (file)
@@ -817,7 +817,7 @@ class DatabaseSqlite extends DatabaseBase {
        /**
         * List all tables on the database
         *
-        * @param $prefix Only show tables with this prefix, e.g. mw_
+        * @param $prefix string Only show tables with this prefix, e.g. mw_
         * @param $fname String: calling function name
         *
         * @return array
index c935eee..b9edc95 100644 (file)
@@ -661,7 +661,7 @@ class Diff {
         *
         *      $diff = new Diff($lines1, $lines2);
         *      $rev = $diff->reverse();
-        * @return object A Diff object representing the inverse of the
+        * @return object object A Diff object representing the inverse of the
         *                                original diff.
         */
        function reverse() {
index 1242853..8cf443f 100644 (file)
@@ -344,7 +344,7 @@ class FileRepo {
        /**
         * Find many files at once.
         *
-        * @param $items An array of titles, or an array of findFile() options with
+        * @param $items array An array of titles, or an array of findFile() options with
         *    the "title" option giving the title. Example:
         *
         *     $findItem = array( 'title' => $title, 'private' => true );
@@ -996,7 +996,7 @@ class FileRepo {
        /**
         * Checks existence of a a file
         *
-        * @param $file Virtual URL (or storage path) of file to check
+        * @param $file string Virtual URL (or storage path) of file to check
         * @param $flags Integer: bitwise combination of the following flags:
         *     self::FILES_ONLY     Mark file as existing only if it is a file (not directory)
         * @return bool
@@ -1012,7 +1012,7 @@ class FileRepo {
         * @param $files Array: Virtual URLs (or storage paths) of files to check
         * @param $flags Integer: bitwise combination of the following flags:
         *     self::FILES_ONLY     Mark file as existing only if it is a file (not directory)
-        * @return Either array of files and existence flags, or false
+        * @return array|bool Either array of files and existence flags, or false
         */
        public function fileExistsBatch( $files, $flags = 0 ) {
                $result = array();
index 99c1115..277364e 100644 (file)
@@ -213,7 +213,7 @@ class RepoGroup {
         * Returns false if the file does not exist.
         *
         * @param $hash String base 36 SHA-1 hash
-        * @param $options Option array, same as findFile()
+        * @param $options array Option array, same as findFile()
         * @return File object or false if it is not found
         */
        function findFileFromKey( $hash, $options = array() ) {
@@ -339,7 +339,8 @@ class RepoGroup {
 
        /**
         * Split a virtual URL into repo, zone and rel parts
-        * @return an array containing repo, zone and rel
+        * @param $url string
+        * @return array containing repo, zone and rel
         */
        function splitVirtualUrl( $url ) {
                if ( substr( $url, 0, 9 ) != 'mwrepo://' ) {
index 5d5647e..1bc79fa 100644 (file)
@@ -987,8 +987,8 @@ abstract class File {
         *
         * STUB
         * @param $limit integer Limit of rows to return
-        * @param $start timestamp Only revisions older than $start will be returned
-        * @param $end timestamp Only revisions newer than $end will be returned
+        * @param $start string timestamp Only revisions older than $start will be returned
+        * @param $end string timestamp Only revisions newer than $end will be returned
         * @param $inc bool Include the endpoints of the time range
         *
         * @return array
@@ -1185,7 +1185,7 @@ abstract class File {
         *
         * @param $suffix bool|string if not false, the name of a thumbnail file
         *
-        * @return path
+        * @return string path
         */
        function getThumbUrl( $suffix = false ) {
                $this->assertRepoDefined();
index bf05771..47943b3 100644 (file)
@@ -1301,7 +1301,7 @@ class LocalFile extends File {
         *
         * May throw database exceptions on error.
         *
-        * @param $versions set of record ids of deleted items to restore,
+        * @param $versions array set of record ids of deleted items to restore,
         *                    or empty to restore all revisions.
         * @param $unsuppress Boolean
         * @return FileRepoStatus
index 658a3b1..89444bc 100644 (file)
@@ -207,7 +207,7 @@ class SqliteInstaller extends DatabaseInstaller {
        }
 
        /**
-        * @return Staus
+        * @return Status
         */
        public function createTables() {
                $status = parent::createTables();
index ff8185a..85ec880 100644 (file)
@@ -341,7 +341,7 @@ class WebInstaller_ExistingWiki extends WebInstallerPage {
 
        /**
         * Initiate an upgrade of the existing database
-        * @param $vars Variables from LocalSettings.php and AdminSettings.php
+        * @param $vars array Variables from LocalSettings.php and AdminSettings.php
         * @return Status
         */
        protected function handleExistingUpgrade( $vars ) {
index c8fc296..792079a 100644 (file)
@@ -122,7 +122,7 @@ class CSSJanus {
         * @param $css String: stylesheet to transform
         * @param $swapLtrRtlInURL Boolean: If true, swap 'ltr' and 'rtl' in URLs
         * @param $swapLeftRightInURL Boolean: If true, swap 'left' and 'right' in URLs
-        * @return Transformed stylesheet
+        * @return string Transformed stylesheet
         */
        public static function transform( $css, $swapLtrRtlInURL = false, $swapLeftRightInURL = false ) {
                // We wrap tokens in ` , not ~ like the original implementation does.
index dcdf7b3..99461b0 100644 (file)
@@ -73,7 +73,7 @@ class IEUrlExtension {
         * a potentially harmful file extension.
         *
         * @param $urlPart string The right-hand portion of a URL
-        * @param $extWhitelist An array of file extensions which may occur in this
+        * @param $extWhitelist array An array of file extensions which may occur in this
         *    URL, and which should be allowed.
         * @return bool
         */