More return documentation
authorSam Reed <reedy@users.mediawiki.org>
Thu, 9 Feb 2012 21:33:27 +0000 (21:33 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 9 Feb 2012 21:33:27 +0000 (21:33 +0000)
49 files changed:
includes/Action.php
includes/AjaxResponse.php
includes/Article.php
includes/AuthPlugin.php
includes/BacklinkCache.php
includes/Category.php
includes/CategoryPage.php
includes/CategoryViewer.php
includes/ChangesList.php
includes/ConfEditor.php
includes/Cookie.php
includes/Export.php
includes/ExternalStoreDB.php
includes/Feed.php
includes/FeedUtils.php
includes/FileDeleteForm.php
includes/ForkController.php
includes/FormOptions.php
includes/GlobalFunctions.php
includes/HttpFunctions.php
includes/ImageGallery.php
includes/ImagePage.php
includes/Import.php
includes/actions/HistoryAction.php
includes/api/ApiUpload.php
includes/cache/MessageCache.php
includes/db/Database.php
includes/db/DatabaseIbm_db2.php
includes/db/DatabaseMssql.php
includes/db/DatabaseOracle.php
includes/db/DatabasePostgres.php
includes/db/DatabaseSqlite.php
includes/debug/Debug.php
includes/diff/DifferenceEngine.php
includes/filerepo/FileRepo.php
includes/filerepo/ForeignAPIRepo.php
includes/filerepo/ForeignDBRepo.php
includes/filerepo/ForeignDBViaLBRepo.php
includes/filerepo/LocalRepo.php
includes/filerepo/RepoGroup.php
includes/filerepo/backend/FSFileBackend.php
includes/filerepo/backend/FileBackend.php
includes/filerepo/backend/FileBackendMultiWrite.php
includes/filerepo/backend/SwiftFileBackend.php
includes/filerepo/backend/lockmanager/DBLockManager.php
includes/filerepo/file/File.php
includes/filerepo/file/ForeignAPIFile.php
includes/filerepo/file/LocalFile.php
includes/filerepo/file/OldLocalFile.php

index 328ce97..66f3513 100644 (file)
@@ -501,6 +501,7 @@ abstract class FormlessAction extends Action {
 
        /**
         * We don't want an HTMLForm
+        * @return bool
         */
        protected function getFormFields() {
                return false;
index 31d9478..e946397 100644 (file)
@@ -141,6 +141,7 @@ class AjaxResponse {
         * possible. If sucessful, the AjaxResponse is disabled so that
         * any future call to AjaxResponse::printText() have no effect. The method
         * returns true iff the response code was set to 304 Not Modified.
+        * @return bool
         */
        function checkLastModified ( $timestamp ) {
                global $wgCachePages, $wgCacheEpoch, $wgUser;
index b21f71f..6361155 100644 (file)
@@ -1770,6 +1770,7 @@ class Article extends Page {
         *
         * @param $fname String Name of called method
         * @param $args Array Arguments to the method
+        * @return mixed
         */
        public function __call( $fname, $args ) {
                if ( is_callable( array( $this->mPage, $fname ) ) ) {
index 2fdba79..07a614a 100644 (file)
@@ -103,6 +103,7 @@ class AuthPlugin {
         * forget the & on your function declaration.
         *
         * @param $user User object
+        * @return bool
         */
        public function updateUser( &$user ) {
                # Override this and do something
index 152c5f0..c028352 100644 (file)
@@ -179,6 +179,7 @@ class BacklinkCache {
        /**
         * Get the field name prefix for a given table
         * @param $table String
+        * @return null|string
         */
        protected function getPrefix( $table ) {
                static $prefixes = array(
@@ -206,6 +207,7 @@ class BacklinkCache {
         * Get the SQL condition array for selecting backlinks, with a join
         * on the page table.
         * @param $table String
+        * @return array|null
         */
        protected function getConditions( $table ) {
                $prefix = $this->getPrefix( $table );
index c51a7c4..0be4830 100644 (file)
@@ -231,7 +231,10 @@ class Category {
                );
        }
 
-       /** Generic accessor */
+       /**
+        * Generic accessor
+        * @return bool
+        */
        private function getX( $key ) {
                if ( !$this->initialize() ) {
                        return false;
index eab7a35..3c7d89e 100644 (file)
@@ -29,6 +29,7 @@ class CategoryPage extends Article {
        /**
         * Constructor from a page id
         * @param $id Int article ID to load
+        * @return CategoryPage|null
         */
        public static function newFromID( $id ) {
                $t = Title::newFromID( $id );
index e8e9142..dff3802 100644 (file)
@@ -172,7 +172,8 @@ class CategoryViewer extends ContextSource {
        *
        * @param Title $title
        * @param string $sortkey The human-readable sortkey (before transforming to icu or whatever).
-       */
+        * @return string
+        */
        function getSubcategorySortChar( $title, $sortkey ) {
                global $wgContLang;
 
index ff07969..8a1f375 100644 (file)
@@ -364,6 +364,7 @@ class ChangesList extends ContextSource {
         * Insert a formatted action
         *
         * @param $rc RecentChange
+        * @return string
         */
        public function insertLogEntry( $rc ) {
                $formatter = LogFormatter::newFromRow( $rc->mAttribs );
@@ -375,6 +376,7 @@ class ChangesList extends ContextSource {
        /** 
         * Insert a formatted comment
         * @param $rc RecentChange
+        * @return string
         */
        public function insertComment( $rc ) {
                if( $rc->mAttribs['rc_type'] != RC_MOVE && $rc->mAttribs['rc_type'] != RC_MOVE_OVER_REDIRECT ) {
@@ -397,6 +399,7 @@ class ChangesList extends ContextSource {
 
        /**
         * Returns the string which indicates the number of watching users
+        * @return string
         */
        protected function numberofWatchingusers( $count ) {
                static $cache = array();
@@ -514,6 +517,7 @@ class OldChangesList extends ChangesList {
         * Format a line using the old system (aka without any javascript).
         *
         * @param $rc RecentChange
+        * @return string
         */
        public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
                global $wgRCShowChangedSize;
@@ -779,6 +783,7 @@ class EnhancedChangesList extends ChangesList {
 
        /**
         * Enhanced RC group
+        * @return string
         */
        protected function recentChangesBlockGroup( $block ) {
                global $wgRCShowChangedSize;
index 42a7173..4aecb3d 100644 (file)
@@ -139,6 +139,7 @@ class ConfEditor {
         * insert
         *    Insert a new element at the start of the array.
         *
+        * @return string
         */
        public function edit( $ops ) {
                $this->parse();
@@ -371,6 +372,7 @@ class ConfEditor {
         * Finds the source byte region which you would want to delete, if $pathName
         * was to be deleted. Includes the leading spaces and tabs, the trailing line
         * break, and any comments in between.
+        * @return array
         */
        function findDeletionRegion( $pathName ) {
                if ( !isset( $this->pathInfo[$pathName] ) ) {
@@ -428,6 +430,7 @@ class ConfEditor {
         * or semicolon.
         *
         * The end position is the past-the-end (end + 1) value as per convention.
+        * @return array
         */
        function findValueRegion( $pathName ) {
                if ( !isset( $this->pathInfo[$pathName] ) ) {
@@ -444,6 +447,7 @@ class ConfEditor {
         * Find the path name of the last element in the array.
         * If the array is empty, this will return the \@extra interstitial element.
         * If the specified path is not found or is not an array, it will return false.
+        * @return bool|int|string
         */
        function findLastArrayElement( $path ) {
                // Try for a real element
@@ -480,6 +484,7 @@ class ConfEditor {
         * Find the path name of first element in the array.
         * If the array is empty, this will return the \@extra interstitial element.
         * If the specified path is not found or is not an array, it will return false.
+        * @return bool|int|string
         */
        function findFirstArrayElement( $path ) {
                // Try for an ordinary element
@@ -504,6 +509,7 @@ class ConfEditor {
        /**
         * Get the indent string which sits after a given start position.
         * Returns false if the position is not at the start of the line.
+        * @return array
         */
        function getIndent( $pos, $key = false, $arrowPos = false ) {
                $arrowIndent = ' ';
@@ -725,6 +731,7 @@ class ConfEditor {
 
        /**
         * Create a ConfEditorToken from an element of token_get_all()
+        * @return \ConfEditorToken
         */
        function newTokenObj( $internalToken ) {
                if ( is_array( $internalToken ) ) {
@@ -776,6 +783,7 @@ class ConfEditor {
        /**
         * Get the token $offset steps ahead of the current position.
         * $offset may be negative, to get tokens behind the current position.
+        * @return \ConfEditorToken
         */
        function getTokenAhead( $offset ) {
                $pos = $this->pos + $offset;
@@ -821,6 +829,7 @@ class ConfEditor {
 
        /**
         * Pop a state from the state stack.
+        * @return mixed
         */
        function popState() {
                return array_pop( $this->stateStack );
@@ -829,6 +838,7 @@ class ConfEditor {
        /**
         * Returns true if the user input path is valid.
         * This exists to allow "/" and "@" to be reserved for string path keys
+        * @return bool
         */
        function validatePath( $path ) {
                return strpos( $path, '/' ) === false && substr( $path, 0, 1 ) != '@';
@@ -949,6 +959,7 @@ class ConfEditor {
 
        /**
         * Get a readable name for the given token type.
+        * @return string
         */
        function getTypeName( $type ) {
                if ( is_int( $type ) ) {
@@ -962,6 +973,7 @@ class ConfEditor {
         * Looks ahead to see if the given type is the next token type, starting
         * from the current position plus the given offset. Skips any intervening
         * whitespace.
+        * @return bool
         */
        function isAhead( $type, $offset = 0 ) {
                $ahead = $offset;
index 76739cc..b76212e 100644 (file)
@@ -193,6 +193,7 @@ class CookieJar {
 
        /**
         * @see Cookie::serializeToHttpRequest
+        * @return string
         */
        public function serializeToHttpRequest( $path, $domain ) {
                $cookies = array();
@@ -213,6 +214,7 @@ class CookieJar {
         *
         * @param $cookie String
         * @param $domain String: cookie's domain
+        * @return null
         */
        public function parseCookieResponseHeader ( $cookie, $domain ) {
                $len = strlen( 'Set-Cookie:' );
index 7773d03..73fa39e 100644 (file)
@@ -507,6 +507,7 @@ class XmlDumpWriter {
         * Closes a <page> section on the output stream.
         *
         * @access private
+        * @return string
         */
        function closePage() {
                return "  </page>\n";
@@ -633,6 +634,7 @@ class XmlDumpWriter {
 
        /**
         * Warning! This data is potentially inconsistent. :(
+        * @return string
         */
        function writeUploads( $row, $dumpContents = false ) {
                if ( $row->page_namespace == NS_IMAGE ) {
@@ -773,6 +775,7 @@ class DumpOutput {
        /**
         * Returns the name of the file or files which are
         * being written to, if there are any.
+        * @return null
         */
        function getFilenames() {
                return NULL;
index 4920a91..e11a53d 100644 (file)
@@ -73,6 +73,7 @@ class ExternalStoreDB {
        /**
         * Fetch data from given URL
         * @param $url String: an url of the form DB://cluster/id or DB://cluster/id/itemid for concatened storage.
+        * @return mixed
         */
        function fetchFromURL( $url ) {
                $path = explode( '/', $url );
index 351f357..950b437 100644 (file)
@@ -334,6 +334,7 @@ class RSSFeed extends ChannelFeed {
 class AtomFeed extends ChannelFeed {
        /**
         * @todo document
+        * @return string
         */
        function formatTime( $ts ) {
                // need to use RFC 822 time format at least for rss2.0
index cf42329..0e1c8f1 100644 (file)
@@ -165,6 +165,7 @@ class FeedUtils {
         * @param $title Title object: used to generate the diff URL
         * @param $newid Integer newid for this diff
         * @param $oldid Integer|null oldid for the diff. Null means it is a new article
+        * @return string
         */
        protected static function getDiffLink( Title $title, $newid, $oldid = null ) {
                $queryParameters = ($oldid == null)
index 11f9aea..661edaa 100644 (file)
@@ -122,6 +122,7 @@ class FileDeleteForm {
         * @param $reason String: reason of the deletion
         * @param $suppress Boolean: whether to mark all deleted versions as restricted
         * @param $user User object performing the request
+        * @return bool|Status
         */
        public static function doDelete( &$title, &$file, &$oldimage, $reason, $suppress, User $user = null ) {
                if ( $user === null ) {
index 9cacef5..2ada714 100644 (file)
@@ -49,6 +49,7 @@ class ForkController {
         * This will return 'child' in the child processes. In the parent process,
         * it will run until all the child processes exit or a TERM signal is
         * received. It will then return 'done'.
+        * @return string
         */
        public function start() {
                // Trap SIGTERM
index 50068fc..d1a5fd3 100644 (file)
@@ -291,11 +291,17 @@ class FormOptions implements ArrayAccess {
         * @see http://php.net/manual/en/class.arrayaccess.php
         */
        /* @{ */
-       /** Whether option exist*/
+       /**
+        * Whether option exist
+        * @return bool
+        */
        public function offsetExists( $name ) {
                return isset( $this->options[$name] );
        }
-       /** Retrieve an option value */
+       /**
+        * Retrieve an option value
+        * @return Mixed
+        */
        public function offsetGet( $name ) {
                return $this->getValue( $name );
        }
index 7ef6f32..dca4e14 100644 (file)
@@ -20,33 +20,48 @@ if ( !defined( 'MEDIAWIKI' ) ) {
  */
 
 if( !function_exists( 'iconv' ) ) {
-       /** @codeCoverageIgnore */
+       /**
+        * @codeCoverageIgnore
+        * @return string
+        */
        function iconv( $from, $to, $string ) {
                return Fallback::iconv( $from, $to, $string );
        }
 }
 
 if ( !function_exists( 'mb_substr' ) ) {
-       /** @codeCoverageIgnore */
+       /**
+        * @codeCoverageIgnore
+        * @return string
+        */
        function mb_substr( $str, $start, $count='end' ) {
                return Fallback::mb_substr( $str, $start, $count );
        }
 
-       /** @codeCoverageIgnore */
+       /**
+        * @codeCoverageIgnore
+        * @return int
+        */
        function mb_substr_split_unicode( $str, $splitPos ) {
                return Fallback::mb_substr_split_unicode( $str, $splitPos );
        }
 }
 
 if ( !function_exists( 'mb_strlen' ) ) {
-       /** @codeCoverageIgnore */
+       /**
+        * @codeCoverageIgnore
+        * @return int
+        */
        function mb_strlen( $str, $enc = '' ) {
                return Fallback::mb_strlen( $str, $enc );
        }
 }
 
 if( !function_exists( 'mb_strpos' ) ) {
-       /** @codeCoverageIgnore */
+       /**
+        * @codeCoverageIgnore
+        * @return int
+        */
        function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
                return Fallback::mb_strpos( $haystack, $needle, $offset, $encoding );
        }
@@ -54,7 +69,10 @@ if( !function_exists( 'mb_strpos' ) ) {
 }
 
 if( !function_exists( 'mb_strrpos' ) ) {
-       /** @codeCoverageIgnore */
+       /**
+        * @codeCoverageIgnore
+        * @return int
+        */
        function mb_strrpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
                return Fallback::mb_strrpos( $haystack, $needle, $offset, $encoding );
        }
@@ -63,7 +81,10 @@ if( !function_exists( 'mb_strrpos' ) ) {
 
 // Support for Wietse Venema's taint feature
 if ( !function_exists( 'istainted' ) ) {
-       /** @codeCoverageIgnore */
+       /**
+        * @codeCoverageIgnore
+        * @return int
+        */
        function istainted( $var ) {
                return 0;
        }
@@ -885,6 +906,7 @@ function wfDebug( $text, $logonly = false ) {
 
 /**
  * Returns true if debug logging should be suppressed if $wgDebugRawPage = false
+ * @return bool
  */
 function wfIsDebugRawPage() {
        static $cache;
index 8a8249a..4f720e9 100644 (file)
@@ -376,6 +376,7 @@ class MWHttpRequest {
         *
         * @param $fh handle
         * @param $content String
+        * @return int
         */
        public function read( $fh, $content ) {
                $this->content .= $content;
index a3c6e0d..5a8fb8e 100644 (file)
@@ -168,6 +168,7 @@ class ImageGallery {
 
        /**
         * isEmpty() returns true if the gallery contains no images
+        * @return bool
         */
        function isEmpty() {
                return empty( $this->mImages );
@@ -215,6 +216,7 @@ class ImageGallery {
         * - the additional text provided when adding the image
         * - the size of the image
         *
+        * @return string
         */
        function toHTML() {
                global $wgLang;
index e1cc6e7..cc2d5df 100644 (file)
@@ -30,6 +30,7 @@ class ImagePage extends Article {
        /**
         * Constructor from a page id
         * @param $id Int article ID to load
+        * @returnImagePage|null
         */
        public static function newFromID( $id ) {
                $t = Title::newFromID( $id );
index d53810b..497f46c 100644 (file)
@@ -396,6 +396,7 @@ class WikiImporter {
 
        /**
         * Primary entry point
+        * @return bool
         */
        public function doImport() {
                $this->reader->read();
index 254a5db..d64d3cb 100644 (file)
@@ -782,6 +782,7 @@ class HistoryPager extends ReverseChronologicalPager {
 
        /**
         * Get the "prevent clickjacking" flag
+        * @return bool
         */
        function getPreventClickjacking() {
                return $this->preventClickjacking;
index fdc1eff..9136e8c 100644 (file)
@@ -113,6 +113,7 @@ class ApiUpload extends ApiBase {
        }
        /**
         * Get an uplaod result based on upload context
+        * @return array
         */
        private function getContextResult(){
                $warnings = $this->getApiWarnings();
@@ -131,7 +132,8 @@ class ApiUpload extends ApiBase {
                return $this->performUpload();
        }
        /**
-        * Get Stash Result, throws an expetion if the file could not be stashed. 
+        * Get Stash Result, throws an expetion if the file could not be stashed.
+        * @return array
         */
        private function getStashResult(){
                $result = array ();
@@ -149,6 +151,7 @@ class ApiUpload extends ApiBase {
        /**
         * Get Warnings Result
         * @param $warnings Array of Api upload warnings
+        * @return array
         */
        private function getWarningsResult( $warnings ){
                $result = array();
@@ -165,7 +168,8 @@ class ApiUpload extends ApiBase {
                return $result;
        }
        /**
-        * Get the result of a chunk upload. 
+        * Get the result of a chunk upload.
+        * @return array
         */
        private function getChunkResult(){
                $result = array();
index 8893373..424b3fd 100644 (file)
@@ -260,6 +260,7 @@ class MessageCache {
         * is disabled.
         *
         * @param $code String: language to which load messages
+        * @return bool
         */
        function load( $code = false ) {
                global $wgUseLocalMessageCache;
index 205409f..7cc9328 100644 (file)
@@ -641,6 +641,7 @@ abstract class DatabaseBase implements DatabaseType {
         * Same as new factory( ... ), kept for backward compatibility
         * @deprecated since 1.18
         * @see Database::factory()
+        * @return DatabaseBase
         */
        public final static function newFromType( $dbType, $p = array() ) {
                wfDeprecated( __METHOD__, '1.18' );
index 613e348..e524752 100644 (file)
@@ -313,6 +313,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
 
        /**
         * Returns true if this database supports (and uses) cascading deletes
+        * @return bool
         */
        function cascadingDeletes() {
                return true;
@@ -321,6 +322,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
        /**
         * Returns true if this database supports (and uses) triggers (e.g. on the
         *  page table)
+        * @return bool
         */
        function cleanupTriggers() {
                return true;
@@ -330,6 +332,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
         * Returns true if this database is strict about what can be put into an
         *  IP field.
         * Specifically, it uses a NULL value instead of an empty string.
+        * @return bool
         */
        function strictIPs() {
                return true;
@@ -337,13 +340,15 @@ class DatabaseIbm_db2 extends DatabaseBase {
 
        /**
         * Returns true if this database uses timestamps rather than integers
-       */
+        * @return bool
+        */
        function realTimestamps() {
                return true;
        }
 
        /**
         * Returns true if this database does an implicit sort when doing GROUP BY
+        * @return bool
         */
        function implicitGroupby() {
                return false;
@@ -353,6 +358,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
         * Returns true if this database does an implicit order by when the column
         *  has an index
         * For example: SELECT page_title FROM page LIMIT 1
+        * @return bool
         */
        function implicitOrderby() {
                return false;
@@ -361,6 +367,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
        /**
         * Returns true if this database can do a native search on IP columns
         * e.g. this works as expected: .. WHERE rc_ip = '127.42.12.102/32';
+        * @return bool
         */
        function searchableIPs() {
                return true;
@@ -368,6 +375,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
 
        /**
         * Returns true if this database can use functional indexes
+        * @return bool
         */
        function functionalIndexes() {
                return true;
@@ -375,6 +383,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
 
        /**
         * Returns a unique string representing the wiki on the server
+        * @return string
         */
        public function getWikiID() {
                if( $this->mSchema ) {
@@ -546,6 +555,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
        /**
         * Closes a database connection, if it is open
         * Returns success, true if already closed
+        * @return bool
         */
        public function close() {
                $this->mOpened = false;
@@ -562,6 +572,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
        /**
         * Retrieves the most current database error
         * Forces a database rollback
+        * @return bool|string
         */
        public function lastError() {
                $connerr = db2_conn_errormsg();
@@ -836,6 +847,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
         *   LIST_SET           - comma separated with field names, like a SET clause
         *   LIST_NAMES         - comma separated field names
         *   LIST_SET_PREPARED  - like LIST_SET, except with ? tokens as values
+        * @return string
         */
        function makeList( $a, $mode = LIST_COMMA ) {
                if ( !is_array( $a ) ) {
@@ -873,6 +885,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
         * @param $sql string SQL query we will append the limit too
         * @param $limit integer the SQL limit
         * @param $offset integer the SQL offset (default false)
+        * @return string
         */
        public function limitResult( $sql, $limit, $offset=false ) {
                if( !is_numeric( $limit ) ) {
@@ -1153,6 +1166,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
         * DELETE query wrapper
         *
         * Use $conds == "*" to delete all rows
+        * @return bool|\ResultWrapper
         */
        public function delete( $table, $conds, $fname = 'DatabaseIbm_db2::delete' ) {
                if ( !$conds ) {
@@ -1640,6 +1654,7 @@ SQL;
         * in the appropriate places.
         * @param $query String
         * @param $args ...
+        * @return Resource
         */
        public function safeQuery( $query, $args = null ) {
                // copied verbatim from Database.php
@@ -1674,6 +1689,7 @@ SQL;
 
        /**
         * Switches module between regular and install modes
+        * @return string
         */
        public function setMode( $mode ) {
                $old = $this->mMode;
index 38be4cb..cf5ee94 100644 (file)
@@ -46,6 +46,7 @@ class DatabaseMssql extends DatabaseBase {
 
        /**
         * Usually aborts on failure
+        * @return bool|DatabaseBase|null
         */
        function open( $server, $user, $password, $dbName ) {
                # Test for driver support, to avoid suppressed fatal error
@@ -107,6 +108,7 @@ class DatabaseMssql extends DatabaseBase {
        /**
         * Closes a database connection, if it is open
         * Returns success, true if already closed
+        * @return bool
         */
        function close() {
                $this->mOpened = false;
@@ -226,6 +228,7 @@ class DatabaseMssql extends DatabaseBase {
 
        /**
         * This must be called after nextSequenceVal
+        * @return null
         */
        function insertId() {
                return $this->mInsertId;
@@ -310,6 +313,7 @@ class DatabaseMssql extends DatabaseBase {
         * This is not necessarily an accurate estimate, so use sparingly
         * Returns -1 if count cannot be found
         * Takes same arguments as Database::select()
+        * @return int
         */
        function estimateRowCount( $table, $vars = '*', $conds = '', $fname = 'DatabaseMssql::estimateRowCount', $options = array() ) {
                $options['EXPLAIN'] = true;// http://msdn2.microsoft.com/en-us/library/aa259203.aspx
@@ -326,6 +330,7 @@ class DatabaseMssql extends DatabaseBase {
        /**
         * Returns information about an index
         * If errors are explicitly ignored, returns NULL on failure
+        * @return array|bool|null
         */
        function indexInfo( $table, $index, $fname = 'DatabaseMssql::indexExists' ) {
                # This does not return the same info as MYSQL would, but that's OK because MediaWiki never uses the
@@ -365,6 +370,7 @@ class DatabaseMssql extends DatabaseBase {
         *
         * Usually aborts on failure
         * If errors are explicitly ignored, returns success
+        * @return bool
         */
        function insert( $table, $arrToInsert, $fname = 'DatabaseMssql::insert', $options = array() ) {
                # No rows to insert, easy just return now
@@ -494,6 +500,7 @@ class DatabaseMssql extends DatabaseBase {
         * Source items may be literals rather than field names, but strings should be quoted with Database::addQuotes()
         * $conds may be "*" to copy the whole table
         * srcTable may be an array of tables.
+        * @return null|\ResultWrapper
         */
        function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = 'DatabaseMssql::insertSelect',
                $insertOptions = array(), $selectOptions = array() ) {
@@ -511,6 +518,7 @@ class DatabaseMssql extends DatabaseBase {
 
        /**
         * Return the next in a sequence, save the value for retrieval via insertId()
+        * @return
         */
        function nextSequenceValue( $seqName ) {
                if ( !$this->tableExists( 'sequence_' . $seqName ) ) {
@@ -527,6 +535,7 @@ class DatabaseMssql extends DatabaseBase {
 
        /**
         * Return the current value of a sequence. Assumes it has ben nextval'ed in this session.
+        * @return
         */
        function currentSequenceValue( $seqName ) {
                $ret = sqlsrv_query( $this->mConn, "SELECT TOP 1 id FROM [sequence_$seqName] ORDER BY id DESC" );
@@ -559,6 +568,7 @@ class DatabaseMssql extends DatabaseBase {
         * $sql string SQL query we will append the limit too
         * $limit integer the SQL limit
         * $offset integer the SQL offset (default false)
+        * @return mixed|string
         */
        function limitResult( $sql, $limit, $offset = false ) {
                if ( $offset === false || $offset == 0 ) {
@@ -647,6 +657,7 @@ class DatabaseMssql extends DatabaseBase {
 
        /**
         * Query whether a given column exists in the mediawiki schema
+        * @return bool
         */
        function fieldExists( $table, $field, $fname = 'DatabaseMssql::fieldExists' ) {
                $table = $this->tableName( $table );
@@ -707,6 +718,7 @@ class DatabaseMssql extends DatabaseBase {
         * Escapes a identifier for use inm SQL.
         * Throws an exception if it is invalid.
         * Reference: http://msdn.microsoft.com/en-us/library/aa224033%28v=SQL.80%29.aspx
+        * @return string
         */
        private function escapeIdentifier( $identifier ) {
                if ( strlen( $identifier ) == 0 ) {
@@ -795,6 +807,7 @@ class DatabaseMssql extends DatabaseBase {
 
        /**
         * @private
+        * @return string
         */
        function tableNamesWithUseIndexOrJOIN( $tables, $use_index = array(), $join_conds = array() ) {
                $ret = array();
@@ -893,6 +906,7 @@ class DatabaseMssql extends DatabaseBase {
 
        /**
         * Get the type of the DBMS, as it appears in $wgDBtype.
+        * @return string
         */
        function getType(){
                return 'mssql';
@@ -909,6 +923,7 @@ class DatabaseMssql extends DatabaseBase {
        /**
         * Since MSSQL doesn't recognize the infinity keyword, set date manually.
         * @todo Remove magic date
+        * @return string
         */
        public function getInfinity() {
                return '3000-01-31 00:00:00.000';
index 855fc83..8a35ad5 100644 (file)
@@ -226,6 +226,7 @@ class DatabaseOracle extends DatabaseBase {
 
        /**
         * Usually aborts on failure
+        * @return DatabaseBase|null
         */
        function open( $server, $user, $password, $dbName ) {
                if ( !function_exists( 'oci_connect' ) ) {
@@ -285,6 +286,7 @@ class DatabaseOracle extends DatabaseBase {
        /**
         * Closes a database connection, if it is open
         * Returns success, true if already closed
+        * @return bool
         */
        function close() {
                $this->mOpened = false;
@@ -401,6 +403,7 @@ class DatabaseOracle extends DatabaseBase {
 
        /**
         * This must be called after nextSequenceVal
+        * @return null
         */
        function insertId() {
                return $this->mInsertId;
@@ -439,6 +442,7 @@ class DatabaseOracle extends DatabaseBase {
        /**
         * Returns information about an index
         * If errors are explicitly ignored, returns NULL on failure
+        * @return bool
         */
        function indexInfo( $table, $index, $fname = 'DatabaseOracle::indexExists' ) {
                return false;
@@ -679,6 +683,7 @@ class DatabaseOracle extends DatabaseBase {
        }
        /**
         * Return the next in a sequence, save the value for retrieval via insertId()
+        * @return null
         */
        function nextSequenceValue( $seqName ) {
                $res = $this->query( "SELECT $seqName.nextval FROM dual" );
@@ -689,6 +694,7 @@ class DatabaseOracle extends DatabaseBase {
 
        /**
         * Return sequence_name if table has a sequence
+        * @return bool
         */
        private function getSequenceData( $table ) {
                if ( $this->sequenceData == null ) {
@@ -836,6 +842,7 @@ class DatabaseOracle extends DatabaseBase {
 
        /**
         * Query whether a given index exists
+        * @return bool
         */
        function indexExists( $table, $index, $fname = 'DatabaseOracle::indexExists' ) {
                $table = $this->tableName( $table );
@@ -855,6 +862,7 @@ class DatabaseOracle extends DatabaseBase {
 
        /**
         * Query whether a given table exists (in the given schema, or the default mw one if not given)
+        * @return int
         */
        function tableExists( $table, $fname = __METHOD__ ) {
                $table = $this->tableName( $table );
index 2b0c0a3..71a84b4 100644 (file)
@@ -145,6 +145,7 @@ class DatabasePostgres extends DatabaseBase {
 
        /**
         * Usually aborts on failure
+        * @return DatabaseBase|null
         */
        function open( $server, $user, $password, $dbName ) {
                # Test for Postgres support, to avoid suppressed fatal error
@@ -237,6 +238,7 @@ class DatabasePostgres extends DatabaseBase {
        /**
         * Closes a database connection, if it is open
         * Returns success, true if already closed
+        * @return bool
         */
        function close() {
                $this->mOpened = false;
@@ -331,6 +333,7 @@ class DatabasePostgres extends DatabaseBase {
 
        /**
         * This must be called after nextSequenceVal
+        * @return null
         */
        function insertId() {
                return $this->mInsertId;
@@ -371,6 +374,7 @@ class DatabasePostgres extends DatabaseBase {
         * This is not necessarily an accurate estimate, so use sparingly
         * Returns -1 if count cannot be found
         * Takes same arguments as Database::select()
+        * @return int
         */
        function estimateRowCount( $table, $vars = '*', $conds='', $fname = 'DatabasePostgres::estimateRowCount', $options = array() ) {
                $options['EXPLAIN'] = true;
@@ -389,6 +393,7 @@ class DatabasePostgres extends DatabaseBase {
        /**
         * Returns information about an index
         * If errors are explicitly ignored, returns NULL on failure
+        * @return bool|null
         */
        function indexInfo( $table, $index, $fname = 'DatabasePostgres::indexInfo' ) {
                $sql = "SELECT indexname FROM pg_indexes WHERE tablename='$table'";
@@ -555,6 +560,7 @@ class DatabasePostgres extends DatabaseBase {
         * $conds may be "*" to copy the whole table
         * srcTable may be an array of tables.
         * @todo FIXME: Implement this a little better (seperate select/insert)?
+        * @return bool
         */
        function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = 'DatabasePostgres::insertSelect',
                $insertOptions = array(), $selectOptions = array() )
@@ -637,6 +643,7 @@ class DatabasePostgres extends DatabaseBase {
 
        /**
         * Return the next in a sequence, save the value for retrieval via insertId()
+        * @return null
         */
        function nextSequenceValue( $seqName ) {
                $safeseq = str_replace( "'", "''", $seqName );
@@ -648,6 +655,7 @@ class DatabasePostgres extends DatabaseBase {
 
        /**
         * Return the current value of a sequence. Assumes it has been nextval'ed in this session.
+        * @return
         */
        function currentSequenceValue( $seqName ) {
                $safeseq = str_replace( "'", "''", $seqName );
@@ -747,6 +755,7 @@ class DatabasePostgres extends DatabaseBase {
        /**
         * Query whether a given relation exists (in the given schema, or the
         * default mw one if not given)
+        * @return bool
         */
        function relationExists( $table, $types, $schema = false ) {
                global $wgDBmwschema;
@@ -770,6 +779,7 @@ class DatabasePostgres extends DatabaseBase {
        /**
         * For backward compatibility, this function checks both tables and
         * views.
+        * @return bool
         */
        function tableExists( $table, $fname = __METHOD__, $schema = false ) {
                return $this->relationExists( $table, array( 'r', 'v' ), $schema );
@@ -833,6 +843,7 @@ SQL;
 
        /**
         * Query whether a given schema exists. Returns true if it does, false if it doesn't.
+        * @return bool
         */
        function schemaExists( $schema ) {
                $exists = $this->selectField( '"pg_catalog"."pg_namespace"', 1,
@@ -842,6 +853,7 @@ SQL;
 
        /**
         * Returns true if a given role (i.e. user) exists, false otherwise.
+        * @return bool
         */
        function roleExists( $roleName ) {
                $exists = $this->selectField( '"pg_catalog"."pg_roles"', 1,
@@ -855,6 +867,7 @@ SQL;
 
        /**
         * pg_field_type() wrapper
+        * @return string
         */
        function fieldType( $res, $index ) {
                if ( $res instanceof ResultWrapper ) {
index fb0e499..169da2b 100644 (file)
@@ -497,6 +497,7 @@ class DatabaseSqlite extends DatabaseBase {
 
        /**
         * Based on generic method (parent) with some prior SQLite-sepcific adjustments
+        * @return bool
         */
        function insert( $table, $a, $fname = 'DatabaseSqlite::insert', $options = array() ) {
                if ( !count( $a ) ) {
@@ -723,6 +724,7 @@ class DatabaseSqlite extends DatabaseBase {
 
        /**
         * No-op version of deadlockLoop
+        * @return mixed
         */
        public function deadlockLoop( /*...*/ ) {
                $args = func_get_args();
index 376402f..eaf8828 100644 (file)
@@ -87,6 +87,7 @@ class MWDebug {
 
        /**
         * Returns internal log array
+        * @return array
         */
        public static function getLog() {
                return self::$log;
index 439e320..a4d0c65 100644 (file)
@@ -672,6 +672,7 @@ class DifferenceEngine extends ContextSource {
         *
         * @param $otext String: old text, must be already segmented
         * @param $ntext String: new text, must be already segmented
+        * @return bool|string
         */
        function generateDiffBody( $otext, $ntext ) {
                global $wgExternalDiffEngine, $wgContLang;
@@ -747,6 +748,7 @@ class DifferenceEngine extends ContextSource {
        /**
         * Generate a debug comment indicating diff generating time,
         * server node, and generator backend.
+        * @return string
         */
        protected function debug( $generator = "internal" ) {
                global $wgShowHostnames;
@@ -768,6 +770,7 @@ class DifferenceEngine extends ContextSource {
 
        /**
         * Replace line numbers with the text in the user's language
+        * @return mixed
         */
        function localiseLineNumbers( $text ) {
                return preg_replace_callback( '/<!--LINE (\d+)-->/',
index 8cf443f..4555d4d 100644 (file)
@@ -411,6 +411,7 @@ class FileRepo {
         * SHA-1 content hash.
         *
         * STUB
+        * @return array
         */
        public function findBySha1( $hash ) {
                return array();
@@ -456,6 +457,7 @@ class FileRepo {
         * Get the name of an image from its title object
         *
         * @param $title Title
+        * @return String
         */
        public function getNameFromTitle( Title $title ) {
                global $wgContLang;
@@ -869,6 +871,7 @@ class FileRepo {
         *        be archived, if there is one. Relative to the public zone root.
         * @param $flags Integer: bitfield, may be FileRepo::DELETE_SOURCE to indicate
         *        that the source file should be deleted if possible
+        * @return FileRepoStatus
         */
        public function publish( $srcPath, $dstRel, $archiveRel, $flags = 0 ) {
                $status = $this->publishBatch( array( array( $srcPath, $dstRel, $archiveRel ) ), $flags );
@@ -1422,6 +1425,7 @@ class FileRepo {
         * The parameters are the parts of the key, as for wfMemcKey().
         *
         * STUB
+        * @return bool
         */
        function getSharedCacheKey( /*...*/ ) {
                return false;
index e544def..ea15a49 100644 (file)
@@ -77,6 +77,7 @@ class ForeignAPIRepo extends FileRepo {
 
        /**
         * No-ops
+        * @return bool
         */
 
        function storeBatch( $triplets, $flags = 0 ) {
@@ -231,6 +232,7 @@ class ForeignAPIRepo extends FileRepo {
         * @param $width
         * @param $height
         * @param String $param Other rendering parameters (page number, etc) from handler's makeParamString.
+        * @return bool|string
         */
        function getThumbUrlFromCache( $name, $width, $height, $params="" ) {
                global $wgMemc;
@@ -312,6 +314,7 @@ class ForeignAPIRepo extends FileRepo {
 
        /**
         * @see FileRepo::getZoneUrl()
+        * @return String
         */
        function getZoneUrl( $zone ) {
                switch ( $zone ) {
@@ -326,6 +329,7 @@ class ForeignAPIRepo extends FileRepo {
 
        /**
         * Get the local directory corresponding to one of the basic zones
+        * @return bool|null|string
         */
        function getZonePath( $zone ) {
                $supported = array( 'public', 'thumb' );
@@ -345,6 +349,7 @@ class ForeignAPIRepo extends FileRepo {
 
        /**
         * The user agent the ForeignAPIRepo will use.
+        * @return string
         */
        public static function getUserAgent() {
                return Http::userAgent() . " ForeignAPIRepo/" . self::VERSION;
@@ -353,6 +358,7 @@ class ForeignAPIRepo extends FileRepo {
        /**
         * Like a Http:get request, but with custom User-Agent.
         * @see Http:get
+        * @return bool|String
         */
        public static function httpGet( $url, $timeout = 'default', $options = array() ) {
                $options['timeout'] = $timeout;
@@ -362,7 +368,7 @@ class ForeignAPIRepo extends FileRepo {
                $options['method'] = "GET";
 
                if ( !isset( $options['timeout'] ) ) {
-                       $options['timeout'] = 'default';
+                       $options['timeout'] = 'default';
                }
 
                $req = MWHttpRequest::factory( $url, $options );
@@ -370,9 +376,9 @@ class ForeignAPIRepo extends FileRepo {
                $status = $req->execute();
 
                if ( $status->isOK() ) {
-                       return $req->getContent();
+                       return $req->getContent();
                } else {
-                       return false;
+                       return false;
                }
        }
 
index 0311ebc..8eab72f 100644 (file)
@@ -61,6 +61,7 @@ class ForeignDBRepo extends LocalRepo {
         * Get a key on the primary cache for this repository.
         * Returns false if the repository's cache is not accessible at this site. 
         * The parameters are the parts of the key, as for wfMemcKey().
+        * @return bool|mixed
         */
        function getSharedCacheKey( /*...*/ ) {
                if ( $this->hasSharedCache() ) {
index 28b48b5..45dad1a 100644 (file)
@@ -39,6 +39,7 @@ class ForeignDBViaLBRepo extends LocalRepo {
         * Get a key on the primary cache for this repository.
         * Returns false if the repository's cache is not accessible at this site. 
         * The parameters are the parts of the key, as for wfMemcKey().
+        * @return bool|string
         */
        function getSharedCacheKey( /*...*/ ) {
                if ( $this->hasSharedCache() ) {
index cc23fa3..f607cd6 100644 (file)
@@ -189,6 +189,7 @@ class LocalRepo extends FileRepo {
         * We can't say Title object, what database it should use, so we duplicate that function here.
         *
         * @param $title Title
+        * @return bool|int|mixed
         */
        protected function getArticleID( $title ) {
                if( !$title instanceof Title ) {
@@ -233,6 +234,7 @@ class LocalRepo extends FileRepo {
 
        /**
         * Get a connection to the slave DB
+        * @return DatabaseBase
         */
        function getSlaveDB() {
                return wfGetDB( DB_SLAVE );
@@ -240,6 +242,7 @@ class LocalRepo extends FileRepo {
 
        /**
         * Get a connection to the master DB
+        * @return DatabaseBase
         */
        function getMasterDB() {
                return wfGetDB( DB_MASTER );
index 277364e..8096336 100644 (file)
@@ -189,6 +189,7 @@ class RepoGroup {
 
        /**
         * Interface for FileRepo::checkRedirect()
+        * @return bool
         */
        function checkRedirect( Title $title ) {
                if ( !$this->reposInitialised ) {
@@ -251,6 +252,7 @@ class RepoGroup {
 
        /**
         * Get the repo instance with a given key.
+        * @return bool|LocalRepo
         */
        function getRepo( $index ) {
                if ( !$this->reposInitialised ) {
@@ -266,6 +268,7 @@ class RepoGroup {
        }
        /**
         * Get the repo instance by its name
+        * @return bool
         */
        function getRepoByName( $name ) {
                if ( !$this->reposInitialised ) {
@@ -294,6 +297,7 @@ class RepoGroup {
         *
         * @param $callback Callback: the function to call
         * @param $params Array: optional additional parameters to pass to the function
+        * @return bool
         */
        function forEachForeignRepo( $callback, $params = array() ) {
                foreach( $this->foreignRepos as $repo ) {
index 8b60290..f39f1f3 100644 (file)
@@ -62,6 +62,7 @@ class FSFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::resolveContainerPath()
+        * @return null|string
         */
        protected function resolveContainerPath( $container, $relStoragePath ) {
                // Check that container has a root directory
@@ -130,6 +131,7 @@ class FSFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::isPathUsableInternal()
+        * @return bool
         */
        public function isPathUsableInternal( $storagePath ) {
                $fsPath = $this->resolveToFSPath( $storagePath );
@@ -151,6 +153,7 @@ class FSFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doStoreInternal()
+        * @return Status
         */
        protected function doStoreInternal( array $params ) {
                $status = Status::newGood();
@@ -191,6 +194,7 @@ class FSFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doCopyInternal()
+        * @return Status
         */
        protected function doCopyInternal( array $params ) {
                $status = Status::newGood();
@@ -237,6 +241,7 @@ class FSFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doMoveInternal()
+        * @return Status
         */
        protected function doMoveInternal( array $params ) {
                $status = Status::newGood();
@@ -285,6 +290,7 @@ class FSFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doDeleteInternal()
+        * @return Status
         */
        protected function doDeleteInternal( array $params ) {
                $status = Status::newGood();
@@ -315,6 +321,7 @@ class FSFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doCreateInternal()
+        * @return Status
         */
        protected function doCreateInternal( array $params ) {
                $status = Status::newGood();
@@ -355,6 +362,7 @@ class FSFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doPrepareInternal()
+        * @return Status
         */
        protected function doPrepareInternal( $fullCont, $dirRel, array $params ) {
                $status = Status::newGood();
@@ -373,6 +381,7 @@ class FSFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doSecureInternal()
+        * @return Status
         */
        protected function doSecureInternal( $fullCont, $dirRel, array $params ) {
                $status = Status::newGood();
@@ -407,6 +416,7 @@ class FSFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doCleanInternal()
+        * @return Status
         */
        protected function doCleanInternal( $fullCont, $dirRel, array $params ) {
                $status = Status::newGood();
@@ -423,6 +433,7 @@ class FSFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doFileExists()
+        * @return array|bool|null
         */
        protected function doGetFileStat( array $params ) {
                $source = $this->resolveToFSPath( $params['src'] );
@@ -455,6 +466,7 @@ class FSFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::getFileListInternal()
+        * @return array|FSFileBackendFileList|null
         */
        public function getFileListInternal( $fullCont, $dirRel, array $params ) {
                list( $b, $shortCont, $r ) = FileBackend::splitStoragePath( $params['dir'] );
@@ -479,6 +491,7 @@ class FSFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::getLocalReference()
+        * @return FSFile|null
         */
        public function getLocalReference( array $params ) {
                $source = $this->resolveToFSPath( $params['src'] );
@@ -490,6 +503,7 @@ class FSFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::getLocalCopy()
+        * @return null|TempFSFile
         */
        public function getLocalCopy( array $params ) {
                $source = $this->resolveToFSPath( $params['src'] );
index 7cbfb91..bca35b7 100644 (file)
@@ -885,6 +885,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackendStore::moveInternal()
+        * @return Status
         */
        protected function doMoveInternal( array $params ) {
                // Copy source to dest
@@ -899,6 +900,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackend::concatenate()
+        * @return Status
         */
        final public function concatenate( array $params ) {
                wfProfileIn( __METHOD__ );
@@ -917,6 +919,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackendStore::concatenate()
+        * @return Status
         */
        protected function doConcatenate( array $params ) {
                $status = Status::newGood();
@@ -972,6 +975,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackend::doPrepare()
+        * @return Status
         */
        final protected function doPrepare( array $params ) {
                wfProfileIn( __METHOD__ );
@@ -1000,6 +1004,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackendStore::doPrepare()
+        * @return Status
         */
        protected function doPrepareInternal( $container, $dir, array $params ) {
                return Status::newGood();
@@ -1007,6 +1012,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackend::doSecure()
+        * @return Status
         */
        final protected function doSecure( array $params ) {
                wfProfileIn( __METHOD__ );
@@ -1035,6 +1041,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackendStore::doSecure()
+        * @return Status
         */
        protected function doSecureInternal( $container, $dir, array $params ) {
                return Status::newGood();
@@ -1042,6 +1049,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackend::doClean()
+        * @return Status
         */
        final protected function doClean( array $params ) {
                wfProfileIn( __METHOD__ );
@@ -1078,6 +1086,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackendStore::doClean()
+        * @return Status
         */
        protected function doCleanInternal( $container, $dir, array $params ) {
                return Status::newGood();
@@ -1085,6 +1094,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackend::fileExists()
+        * @return bool|null
         */
        final public function fileExists( array $params ) {
                wfProfileIn( __METHOD__ );
@@ -1095,6 +1105,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackend::getFileTimestamp()
+        * @return bool
         */
        final public function getFileTimestamp( array $params ) {
                wfProfileIn( __METHOD__ );
@@ -1105,6 +1116,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackend::getFileSize()
+        * @return bool
         */
        final public function getFileSize( array $params ) {
                wfProfileIn( __METHOD__ );
@@ -1115,6 +1127,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackend::getFileStat()
+        * @return bool|void
         */
        final public function getFileStat( array $params ) {
                wfProfileIn( __METHOD__ );
@@ -1148,6 +1161,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackend::getFileContents()
+        * @return bool|string
         */
        public function getFileContents( array $params ) {
                wfProfileIn( __METHOD__ );
@@ -1165,6 +1179,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackend::getFileSha1Base36()
+        * @return bool
         */
        final public function getFileSha1Base36( array $params ) {
                wfProfileIn( __METHOD__ );
@@ -1184,6 +1199,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackendStore::getFileSha1Base36()
+        * @return bool
         */
        protected function doGetFileSha1Base36( array $params ) {
                $fsFile = $this->getLocalReference( $params );
@@ -1196,6 +1212,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackend::getFileProps()
+        * @return Array
         */
        final public function getFileProps( array $params ) {
                wfProfileIn( __METHOD__ );
@@ -1207,6 +1224,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackend::getLocalReference()
+        * @return null|\TempFSFile
         */
        public function getLocalReference( array $params ) {
                wfProfileIn( __METHOD__ );
@@ -1226,6 +1244,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackend::streamFile()
+        * @return Status
         */
        final public function streamFile( array $params ) {
                wfProfileIn( __METHOD__ );
@@ -1253,6 +1272,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackendStore::streamFile()
+        * @return Status
         */
        protected function doStreamFile( array $params ) {
                $status = Status::newGood();
@@ -1268,7 +1288,8 @@ abstract class FileBackendStore extends FileBackend {
        }
 
        /**
-        * @copydoc FileBackend::getFileList() 
+        * @copydoc FileBackend::getFileList()
+        * @return Array|FileBackendStoreShardListIterator|null|Traversable
         */
        final public function getFileList( array $params ) {
                list( $fullCont, $dir, $shard ) = $this->resolveStoragePath( $params['dir'] );
@@ -1349,6 +1370,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackend::doOperationsInternal()
+        * @return Status
         */
        protected function doOperationsInternal( array $ops, array $opts ) {
                wfProfileIn( __METHOD__ );
index c0f1ac5..95e0eeb 100644 (file)
@@ -76,6 +76,7 @@ class FileBackendMultiWrite extends FileBackend {
 
        /**
         * @see FileBackend::doOperationsInternal()
+        * @return Status
         */
        final protected function doOperationsInternal( array $ops, array $opts ) {
                $status = Status::newGood();
@@ -277,6 +278,7 @@ class FileBackendMultiWrite extends FileBackend {
 
        /**
         * @see FileBackend::doPrepare()
+        * @return Status
         */
        public function doPrepare( array $params ) {
                $status = Status::newGood();
@@ -289,6 +291,7 @@ class FileBackendMultiWrite extends FileBackend {
 
        /**
         * @see FileBackend::doSecure()
+        * @return Status
         */
        public function doSecure( array $params ) {
                $status = Status::newGood();
@@ -301,6 +304,7 @@ class FileBackendMultiWrite extends FileBackend {
 
        /**
         * @see FileBackend::doClean()
+        * @return Status
         */
        public function doClean( array $params ) {
                $status = Status::newGood();
index b0a94c5..fa7a409 100644 (file)
@@ -68,6 +68,7 @@ class SwiftFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::resolveContainerPath()
+        * @return null
         */
        protected function resolveContainerPath( $container, $relStoragePath ) {
                if ( strlen( urlencode( $relStoragePath ) ) > 1024 ) {
@@ -78,6 +79,7 @@ class SwiftFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::isPathUsableInternal()
+        * @return bool
         */
        public function isPathUsableInternal( $storagePath ) {
                list( $container, $rel ) = $this->resolveStoragePathReal( $storagePath );
@@ -99,6 +101,7 @@ class SwiftFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doCreateInternal()
+        * @return Status
         */
        protected function doCreateInternal( array $params ) {
                $status = Status::newGood();
@@ -161,6 +164,7 @@ class SwiftFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doStoreInternal()
+        * @return Status
         */
        protected function doStoreInternal( array $params ) {
                $status = Status::newGood();
@@ -229,6 +233,7 @@ class SwiftFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doCopyInternal()
+        * @return Status
         */
        protected function doCopyInternal( array $params ) {
                $status = Status::newGood();
@@ -284,6 +289,7 @@ class SwiftFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doDeleteInternal()
+        * @return Status
         */
        protected function doDeleteInternal( array $params ) {
                $status = Status::newGood();
@@ -315,6 +321,7 @@ class SwiftFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doPrepareInternal()
+        * @return Status
         */
        protected function doPrepareInternal( $fullCont, $dir, array $params ) {
                $status = Status::newGood();
@@ -360,6 +367,7 @@ class SwiftFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doSecureInternal()
+        * @return Status
         */
        protected function doSecureInternal( $fullCont, $dir, array $params ) {
                $status = Status::newGood();
@@ -394,6 +402,7 @@ class SwiftFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doCleanInternal()
+        * @return Status
         */
        protected function doCleanInternal( $fullCont, $dir, array $params ) {
                $status = Status::newGood();
@@ -438,6 +447,7 @@ class SwiftFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doFileExists()
+        * @return array|bool|null
         */
        protected function doGetFileStat( array $params ) {
                list( $srcCont, $srcRel ) = $this->resolveStoragePathReal( $params['src'] );
@@ -499,6 +509,7 @@ class SwiftFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackend::getFileContents()
+        * @return bool|null|string
         */
        public function getFileContents( array $params ) {
                list( $srcCont, $srcRel ) = $this->resolveStoragePathReal( $params['src'] );
@@ -526,6 +537,7 @@ class SwiftFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::getFileListInternal()
+        * @return SwiftFileBackendFileList
         */
        public function getFileListInternal( $fullCont, $dir, array $params ) {
                return new SwiftFileBackendFileList( $this, $fullCont, $dir );
@@ -559,6 +571,7 @@ class SwiftFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doGetFileSha1base36()
+        * @return bool
         */
        public function doGetFileSha1base36( array $params ) {
                $stat = $this->getFileStat( $params );
@@ -571,6 +584,7 @@ class SwiftFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::doStreamFile()
+        * @return Status
         */
        protected function doStreamFile( array $params ) {
                $status = Status::newGood();
@@ -610,6 +624,7 @@ class SwiftFileBackend extends FileBackendStore {
 
        /**
         * @see FileBackendStore::getLocalCopy()
+        * @return null|TempFSFile
         */
        public function getLocalCopy( array $params ) {
                list( $srcCont, $srcRel ) = $this->resolveStoragePathReal( $params['src'] );
index 8682eb6..641e596 100644 (file)
@@ -90,6 +90,7 @@ class DBLockManager extends LockManager {
 
        /**
         * @see LockManager::doLock()
+        * @return Status
         */
        protected function doLock( array $paths, $type ) {
                $status = Status::newGood();
@@ -140,6 +141,7 @@ class DBLockManager extends LockManager {
 
        /**
         * @see LockManager::doUnlock()
+        * @return Status
         */
        protected function doUnlock( array $paths, $type ) {
                $status = Status::newGood();
index 1bc79fa..88c8a55 100644 (file)
@@ -433,6 +433,7 @@ abstract class File {
         * Get handler-specific metadata
         * Overridden by LocalFile, UnregisteredLocalFile
         * STUB
+        * @return bool
         */
        public function getMetadata() {
                return false;
@@ -462,6 +463,7 @@ abstract class File {
         * Return the bit depth of the file
         * Overridden by LocalFile
         * STUB
+        * @return int
         */
        public function getBitDepth() {
                return 0;
@@ -471,6 +473,7 @@ abstract class File {
         * Return the size of the image file, in bytes
         * Overridden by LocalFile, UnregisteredLocalFile
         * STUB
+        * @return bool
         */
        public function getSize() {
                return false;
@@ -492,6 +495,7 @@ abstract class File {
         * Use the value returned by this function with the MEDIATYPE_xxx constants.
         * Overridden by LocalFile,
         * STUB
+        * @return string
         */
        function getMediaType() {
                return MEDIATYPE_UNKNOWN;
@@ -518,6 +522,7 @@ abstract class File {
 
        /**
         * Accessor for __get()
+        * @return bool
         */
        protected function getCanRender() {
                return $this->canRender();
@@ -938,6 +943,7 @@ abstract class File {
         * Get all thumbnail names previously generated for this file
         * STUB
         * Overridden by LocalFile
+        * @return array
         */
        function getThumbnails() {
                return array();
@@ -1004,6 +1010,7 @@ abstract class File {
         *
         * STUB
         * Overridden in LocalFile
+        * @return bool
         */
        public function nextHistoryLine() {
                return false;
@@ -1360,6 +1367,7 @@ abstract class File {
        /**
         * Return the deletion bitfield
         * STUB
+        * @return int
         */
        function getVisibility() {
                return 0;
index af45e2d..e1350ae 100644 (file)
@@ -68,6 +68,7 @@ class ForeignAPIFile extends File {
 
        /**
         * Get the property string for iiprop and aiprop
+        * @return string
         */
        static function getProps() {
                return 'timestamp|user|comment|url|size|sha1|metadata|mime';
@@ -183,6 +184,7 @@ class ForeignAPIFile extends File {
 
        /**
         * Only useful if we're locally caching thumbs anyway...
+        * @return null|string
         */
        function getThumbPath( $suffix = '' ) {
                if ( $this->repo->canCacheThumbs() ) {
index 47943b3..d053318 100644 (file)
@@ -121,6 +121,7 @@ class LocalFile extends File {
 
        /**
         * Fields in the image table
+        * @return array
         */
        static function selectFields() {
                return array(
@@ -160,6 +161,7 @@ class LocalFile extends File {
        /**
         * Get the memcached key for the main data for this file, or false if
         * there is no access to the shared cache.
+        * @return bool
         */
        function getCacheKey() {
                $hashedName = md5( $this->getName() );
@@ -169,6 +171,7 @@ class LocalFile extends File {
 
        /**
         * Try to load file metadata from memcached. Returns true on success.
+        * @return bool
         */
        function loadFromCache() {
                global $wgMemc;
@@ -286,6 +289,7 @@ class LocalFile extends File {
        /**
         * Decode a row from the database (either object or array) to an array
         * with timestamps and MIME types decoded, and the field prefix removed.
+        * @return array
         */
        function decodeRow( $row, $prefix = 'img_' ) {
                $array = (array)$row;
@@ -474,6 +478,7 @@ class LocalFile extends File {
         * Return the width of the image
         *
         * Returns false on error
+        * @return bool
         */
        public function getWidth( $page = 1 ) {
                $this->load();
@@ -494,6 +499,7 @@ class LocalFile extends File {
         * Return the height of the image
         *
         * Returns false on error
+        * @return bool
         */
        public function getHeight( $page = 1 ) {
                $this->load();
@@ -527,6 +533,7 @@ class LocalFile extends File {
 
        /**
         * Get handler-specific metadata
+        * @return string
         */
        function getMetadata() {
                $this->load();
@@ -824,6 +831,7 @@ class LocalFile extends File {
         *  0      return line for current version
         *  1      query for old versions, return first one
         *  2, ... return next old version from above query
+        * @return bool
         */
        public function nextHistoryLine() {
                # Polymorphic function name to distinguish foreign and local fetches
@@ -920,6 +928,7 @@ class LocalFile extends File {
 
        /**
         * Record a file upload in the upload log and the image table
+        * @return bool
         */
        function recordUpload( $oldver, $desc, $license = '', $copyStatus = '', $source = '',
                $watch = false, $timestamp = false )
@@ -939,6 +948,7 @@ class LocalFile extends File {
 
        /**
         * Record a file upload in the upload log and the image table
+        * @return bool
         */
        function recordUpload2(
                $oldver, $comment, $pageText, $props = false, $timestamp = false, $user = null
@@ -1336,6 +1346,7 @@ class LocalFile extends File {
 
        /**
         * Get the URL of the file description page.
+        * @return String
         */
        function getDescriptionUrl() {
                return $this->title->getLocalUrl();
@@ -1345,6 +1356,7 @@ class LocalFile extends File {
         * Get the HTML text of the description page
         * This is not used by ImagePage for local files, since (among other things)
         * it skips the parser cache.
+        * @return bool|mixed
         */
        function getDescriptionText() {
                global $wgParser;
@@ -1634,6 +1646,7 @@ class LocalFileDeleteBatch {
 
        /**
         * Run the transaction
+        * @return \FileRepoStatus
         */
        function execute() {
                global $wgUseSquid;
@@ -1724,6 +1737,7 @@ class LocalFileDeleteBatch {
 
        /**
         * Removes non-existent files from a deletion batch.
+        * @return array
         */
        function removeNonexistentFiles( $batch ) {
                $files = $newBatch = array();
@@ -1793,6 +1807,7 @@ class LocalFileRestoreBatch {
         * rows and there's no need to keep the image row locked while it's acquiring those locks
         * The caller may have its own transaction open.
         * So we save the batch and let the caller call cleanup()
+        * @return \FileRepoStatus
         */
        function execute() {
                global $wgLang;
@@ -2015,6 +2030,7 @@ class LocalFileRestoreBatch {
 
        /**
         * Removes non-existent files from a store batch.
+        * @return array
         */
        function removeNonexistentFiles( $triplets ) {
                $files = $filteredTriplets = array();
@@ -2034,6 +2050,7 @@ class LocalFileRestoreBatch {
 
        /**
         * Removes non-existent files from a cleanup batch.
+        * @return array
         */
        function removeNonexistentFromCleanup( $batch ) {
                $files = $newBatch = array();
@@ -2058,6 +2075,7 @@ class LocalFileRestoreBatch {
        /**
         * Delete unused files in the deleted zone.
         * This should be called from outside the transaction in which execute() was called.
+        * @return \FileRepoStatus|void
         */
        function cleanup() {
                if ( !$this->cleanupBatch ) {
@@ -2178,6 +2196,7 @@ class LocalFileMoveBatch {
 
        /**
         * Perform the move.
+        * @return \FileRepoStatus
         */
        function execute() {
                $repo = $this->file->repo;
@@ -2268,6 +2287,7 @@ class LocalFileMoveBatch {
 
        /**
         * Generate triplets for FileRepo::storeBatch().
+        * @return array
         */
        function getMoveTriplets() {
                $moves = array_merge( array( $this->cur ), $this->olds );
@@ -2285,6 +2305,7 @@ class LocalFileMoveBatch {
 
        /**
         * Removes non-existent files from move batch.
+        * @return array
         */
        function removeNonexistentFiles( $triplets ) {
                $files = array();
index ebd83c4..3256a75 100644 (file)
@@ -64,6 +64,7 @@ class OldLocalFile extends LocalFile {
        
        /**
         * Fields in the oldimage table
+        * @return array
         */
        static function selectFields() {
                return array(