Documentation followups from lastnight
authorSam Reed <reedy@users.mediawiki.org>
Fri, 10 Feb 2012 15:37:33 +0000 (15:37 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Fri, 10 Feb 2012 15:37:33 +0000 (15:37 +0000)
27 files changed:
includes/Article.php
includes/ChangesList.php
includes/ExternalUser.php
includes/HTMLForm.php
includes/Hooks.php
includes/Import.php
includes/MagicWord.php
includes/Title.php
includes/User.php
includes/WebRequest.php
includes/WikiPage.php
includes/cache/MessageCache.php
includes/db/DatabaseMysql.php
includes/db/DatabaseSqlite.php
includes/db/LoadBalancer.php
includes/diff/DairikiDiff.php
includes/filerepo/FileRepo.php
includes/filerepo/backend/FileBackend.php
includes/filerepo/backend/FileOp.php
includes/filerepo/backend/SwiftFileBackend.php
includes/filerepo/file/ArchivedFile.php
includes/filerepo/file/File.php
includes/filerepo/file/LocalFile.php
includes/media/Generic.php
includes/parser/ParserCache.php
skins/MonoBook.php
skins/Vector.php

index 6361155..99997c8 100644 (file)
@@ -1582,7 +1582,7 @@ class Article extends Page {
 
        /**
         * Get parser options suitable for rendering the primary article wikitext
-        * @return ParserOptions|bool
+        * @return ParserOptions
         */
        public function getParserOptions() {
                global $wgUser;
index 8a1f375..4611611 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
+        * @param $unused string|User Unused
         * @return ChangesList|EnhancedChangesList|OldChangesList derivative
         */
        public static function newFromUser( $unused ) {
index 49d525f..bea0e7e 100644 (file)
@@ -98,7 +98,7 @@ abstract class ExternalUser {
         * This is a wrapper around newFromId().
         *
         * @param $user User
-        * @return ExternalUser|bool
+        * @return ExternalUser|bool False on failure
         */
        public static function newFromUser( $user ) {
                global $wgExternalAuthType;
index ad34909..e9f04c1 100644 (file)
@@ -664,7 +664,7 @@ class HTMLForm extends ContextSource {
 
        /**
         * Get the text for the submit button, either customised or a default.
-        * @return
+        * @return string
         */
        function getSubmitText() {
                return $this->mSubmitText
index 54c18fd..bc39f2f 100644 (file)
@@ -259,7 +259,7 @@ class Hooks {
        /**
         * This REALLY should be protected... but it's public for compatibility
         *
-        * @param $errno
+        * @param $errno int Unused
         * @param $errstr String: error message
         * @return Boolean: false
         */
index 497f46c..d53302b 100644 (file)
@@ -301,7 +301,7 @@ class WikiImporter {
 
        /**
         * Notify the callback function of a revision
-        * @param $revision |WikiRevision object
+        * @param $revision WikiRevision object
         * @return bool|mixed
         */
        private function revisionCallback( $revision ) {
index 14ca4a0..941d97f 100644 (file)
@@ -813,7 +813,7 @@ class MagicWordArray {
         *
         * @param $text string
         *
-        * @return string|bool
+        * @return string|bool False on failure
         */
        public function matchStartToEnd( $text ) {
                $hash = $this->getHash();
@@ -861,7 +861,7 @@ class MagicWordArray {
         *
         * @param $text string
         *
-        * @return int|bool
+        * @return int|bool False on failure
         */
        public function matchStartAndRemove( &$text ) {
                $regexes = $this->getRegexStart();
index fe96ecd..0ef4cda 100644 (file)
@@ -261,7 +261,6 @@ class Title {
         * If false is given, the title will be treated as non-existing.
         *
         * @param $row Object|bool database row
-        * @return void
         */
        public function loadFromRow( $row ) {
                if ( $row ) { // page found
index 26fb7d6..9ac1ef2 100644 (file)
@@ -3381,7 +3381,7 @@ class User {
         * address if it was already confirmed.
         *
         * @note Call saveSettings() after calling this function to commit the change.
-        * @return bool
+        * @return bool Returns true
         */
        function invalidateEmail() {
                $this->load();
index fc41589..826ee0d 100644 (file)
@@ -838,7 +838,7 @@ class WebRequest {
         * Get a request header, or false if it isn't set
         * @param $name String: case-insensitive header name
         *
-        * @return string|bool
+        * @return string|bool False on failure
         */
        public function getHeader( $name ) {
                $this->initHeaders();
index 05401fa..ea66ab7 100644 (file)
@@ -414,7 +414,7 @@ class WikiPage extends Page {
         *      Revision::FOR_PUBLIC       to be displayed to all users
         *      Revision::FOR_THIS_USER    to be displayed to $wgUser
         *      Revision::RAW              get the text regardless of permissions
-        * @return String|bool The text of the current revision
+        * @return String|bool The text of the current revision. False on failure
         */
        public function getText( $audience = Revision::FOR_PUBLIC ) {
                $this->loadLastEdit();
@@ -427,7 +427,7 @@ class WikiPage extends Page {
        /**
         * Get the text of the current revision. No side-effects...
         *
-        * @return String|bool The text of the current revision
+        * @return String|bool The text of the current revision. False on failure
         */
        public function getRawText() {
                $this->loadLastEdit();
index 424b3fd..1d0ab90 100644 (file)
@@ -697,7 +697,7 @@ class MessageCache {
         * @param $title String: Message cache key with initial uppercase letter.
         * @param $code String: code denoting the language to try.
         *
-        * @return string|bool
+        * @return string|bool False on failure
         */
        function getMsgFromNamespace( $title, $code ) {
                global $wgAdaptiveMessageCache;
index 86681fc..b4efd56 100644 (file)
@@ -385,7 +385,7 @@ class DatabaseMysql extends DatabaseBase {
         * @param $table string
         * @param $index string
         * @param $fname string
-        * @return bool|array
+        * @return bool|array|null False or null on failure
         */
        function indexInfo( $table, $index, $fname = 'DatabaseMysql::indexInfo' ) {
                # SHOW INDEX works in MySQL 3.23.58, but SHOW INDEXES does not.
index 169da2b..0556810 100644 (file)
@@ -140,7 +140,7 @@ class DatabaseSqlite extends DatabaseBase {
 
        /**
         * Check if the searchindext table is FTS enabled.
-        * @return bool if not enabled.
+        * @return bool False if not enabled.
         */
        function checkForEnabledSearch() {
                if ( self::$fulltextEnabled === null ) {
@@ -618,7 +618,9 @@ class DatabaseSqlite extends DatabaseBase {
         * Get information about a given field
         * Returns false if the field does not exist.
         *
-        * @return SQLiteField|bool
+        * @param $table string
+        * @param $field string
+        * @return SQLiteField|bool False on failure
         */
        function fieldInfo( $table, $field ) {
                $tableName = $this->tableName( $table );
index 5357eb4..7f200ea 100644 (file)
@@ -385,7 +385,7 @@ class LoadBalancer {
         * Returns false if there is no connection open
         *
         * @param $i int
-        * @return DatabaseBase|bool
+        * @return DatabaseBase|bool False on failure
         */
        function getAnyOpenConnection( $i ) {
                foreach ( $this->mConns as $conns ) {
index b9edc95..e7c4393 100644 (file)
@@ -661,7 +661,7 @@ class Diff {
         *
         *      $diff = new Diff($lines1, $lines2);
         *      $rev = $diff->reverse();
-        * @return object object A Diff object representing the inverse of the
+        * @return Object A Diff object representing the inverse of the
         *                                original diff.
         */
        function reverse() {
index 4555d4d..516b448 100644 (file)
@@ -295,7 +295,7 @@ class FileRepo {
         *     private:        If true, return restricted (deleted) files if the current
         *                     user is allowed to view them. Otherwise, such files will not
         *                     be found.
-        * @return File|bool
+        * @return File|bool False on failure
         */
        public function findFile( $title, $options = array() ) {
                $title = File::normalizeTitle( $title );
@@ -378,7 +378,7 @@ class FileRepo {
         *
         * @param $sha1 String base 36 SHA-1 hash
         * @param $options array Option array, same as findFile().
-        * @return File|bool
+        * @return File|bool False on failure
         */
        public function findFileFromKey( $sha1, $options = array() ) {
                $time = isset( $options['time'] ) ? $options['time'] : false;
@@ -420,7 +420,7 @@ class FileRepo {
        /**
         * Get the public root URL of the repository
         *
-        * @return string|bool
+        * @return string
         */
        public function getRootUrl() {
                return $this->url;
@@ -533,7 +533,7 @@ class FileRepo {
         *
         * @param $query mixed Query string to append
         * @param $entry string Entry point; defaults to index
-        * @return string|bool
+        * @return string|bool False on failure
         */
        public function makeUrl( $query = '', $entry = 'index' ) {
                if ( isset( $this->scriptDirUrl ) ) {
@@ -613,7 +613,7 @@ class FileRepo {
        /**
         * Get the URL of the stylesheet to apply to description pages
         *
-        * @return string|bool
+        * @return string|bool False on failure
         */
        public function getDescriptionStylesheetUrl() {
                if ( isset( $this->scriptDirUrl ) ) {
@@ -1191,7 +1191,7 @@ class FileRepo {
         * Get the timestamp of a file with a given virtual URL/storage path
         *
         * @param $virtualUrl string
-        * @return string|bool
+        * @return string|bool False on failure
         */
        public function getFileTimestamp( $virtualUrl ) {
                $path = $this->resolveToStoragePath( $virtualUrl );
index e1f162c..c949b00 100644 (file)
@@ -1179,7 +1179,7 @@ abstract class FileBackendStore extends FileBackend {
 
        /**
         * @see FileBackend::getFileSha1Base36()
-        * @return bool
+        * @return bool|string
         */
        final public function getFileSha1Base36( array $params ) {
                wfProfileIn( __METHOD__ );
index 300d513..bf35356 100644 (file)
@@ -324,7 +324,7 @@ abstract class FileOp {
         * 
         * @param $source string Storage path
         * @param $predicates Array
-        * @return string|bool
+        * @return string|bool False on failure
         */
        final protected function fileSha1( $source, array $predicates ) {
                if ( isset( $predicates['sha1'][$source] ) ) {
index fa7a409..e2c5986 100644 (file)
@@ -708,7 +708,7 @@ class SwiftFileBackend extends FileBackendStore {
        /**
         * Get a connection to the Swift proxy
         *
-        * @return CF_Connection|bool
+        * @return CF_Connection|bool False on failure
         * @throws InvalidResponseException
         */
        protected function getConnection() {
index 2b43273..9b0844b 100644 (file)
@@ -93,7 +93,7 @@ class ArchivedFile {
 
        /**
         * Loads a file object from the filearchive table
-        * @return bool on success or null
+        * @return bool|null True on success or null
         */
        public function load() {
                if ( $this->dataLoaded ) {
index 88c8a55..543f23f 100644 (file)
@@ -73,14 +73,14 @@ abstract class File {
        var $repo;
 
        /**
-        * @var Title|bool
+        * @var Title
         */
        var $title;
 
        var $lastError, $redirected, $redirectedTitle;
 
        /**
-        * @var FSFile|bool
+        * @var FSFile|bool False if undefined
         */
        protected $fsFile;
 
@@ -252,7 +252,7 @@ abstract class File {
        /**
         * Return the associated title object
         *
-        * @return Title|bool
+        * @return Title
         */
        public function getTitle() {
                return $this->title;
@@ -319,17 +319,17 @@ abstract class File {
        }
 
        /**
-       * Return the storage path to the file. Note that this does
-       * not mean that a file actually exists under that location.
-       *
-       * This path depends on whether directory hashing is active or not,
-       * i.e. whether the files are all found in the same directory,
-       * or in hashed paths like /images/3/3c.
-       *
-       * Most callers don't check the return value, but ForeignAPIFile::getPath
-       * returns false.
+        * Return the storage path to the file. Note that this does
+        * not mean that a file actually exists under that location.
+        *
+        * This path depends on whether directory hashing is active or not,
+        * i.e. whether the files are all found in the same directory,
+        * or in hashed paths like /images/3/3c.
+        *
+        * Most callers don't check the return value, but ForeignAPIFile::getPath
+        * returns false.
         *
-        * @return string|bool
+        * @return string|bool ForeignAPIFile::getPath can return false
        */
        public function getPath() {
                if ( !isset( $this->path ) ) {
@@ -344,7 +344,7 @@ abstract class File {
         * Returns false on failure. Callers must not alter the file.
         * Temporary files are cleared automatically.
         *
-        * @return string|bool
+        * @return string|bool False on failure
         */
        public function getLocalRefPath() {
                $this->assertRepoDefined();
@@ -383,7 +383,7 @@ abstract class File {
         *
         * @param $page int
         *
-        * @return bool|number
+        * @return bool|number False on failure
         */
        public function getHeight( $page = 1 ) {
                return false;
@@ -779,7 +779,7 @@ abstract class File {
         * @param $params Array: an associative array of handler-specific parameters.
         *                Typical keys are width, height and page.
         * @param $flags Integer: a bitfield, may contain self::RENDER_NOW to force rendering
-        * @return MediaTransformOutput|bool
+        * @return MediaTransformOutput|bool False on failure
         */
        function transform( $params, $flags = 0 ) {
                global $wgUseSquid, $wgIgnoreImageErrors, $wgThumbnailEpoch;
index d053318..6fbf9c0 100644 (file)
@@ -627,7 +627,7 @@ class LocalFile extends File {
 
        /**
         * Get all thumbnail names previously generated for this file
-        * @param $archiveName string|bool Name of an archive file
+        * @param $archiveName string|bool Name of an archive file, default false
         * @return array first element is the base dir, then files in that base dir.
         */
        function getThumbnails( $archiveName = false ) {
index af1ca4d..70bc449 100644 (file)
@@ -496,7 +496,7 @@ abstract class MediaHandler {
         *
         * @param $dstPath string The location of the suspect file
         * @param $retval int Return value of some shell process, file will be deleted if this is non-zero
-        * @return bool if removed, false otherwise
+        * @return bool True if removed, false otherwise
         */
        function removeBadFile( $dstPath, $retval = 0 ) {
                if( file_exists( $dstPath ) ) {
@@ -664,7 +664,7 @@ abstract class ImageHandler extends MediaHandler {
         * @param $srcWidth Integer: width of the source image
         * @param $srcHeight Integer: height of the source image
         * @param $mimeType
-        * @return bool to indicate that an error should be returned to the user.
+        * @return bool False to indicate that an error should be returned to the user.
         */
        function validateThumbParams( &$width, &$height, $srcWidth, $srcHeight, $mimeType ) {
                $width = intval( $width );
index bde310e..a8899cb 100644 (file)
@@ -89,7 +89,7 @@ class ParserCache {
         * Retrieve the ParserOutput from ParserCache, even if it's outdated.
         * @param $article Article
         * @param $popts ParserOptions
-        * @return ParserOutput|bool
+        * @return ParserOutput|bool False on failure
         */
        public function getDirty( $article, $popts ) {
                $value = $this->get( $article, $popts, true );
@@ -145,7 +145,7 @@ class ParserCache {
         * @param $popts ParserOptions
         * @param $useOutdated
         *
-        * @return ParserOutput|bool
+        * @return ParserOutput|bool False on failure
         */
        public function get( $article, $popts, $useOutdated = false ) {
                global $wgCacheEpoch;
index f1fe509..857db0f 100644 (file)
@@ -158,6 +158,9 @@ echo $footerEnd;
 
        /*************************************************************************************************/
 
+       /**
+        * @param $sidebar array
+        */
        protected function renderPortals( $sidebar ) {
                if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true;
                if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true;
@@ -265,6 +268,10 @@ echo $footerEnd;
        }
 
        /*************************************************************************************************/
+       /**
+        * @param $bar string
+        * @param $cont array|string
+        */
        function customBox( $bar, $cont ) {
                $portletAttribs = array( 'class' => 'generated-sidebar portlet', 'id' => Sanitizer::escapeId( "p-$bar" ) );
                $tooltip = Linker::titleAttrib( "p-$bar" );
index 4b6433d..0c7686a 100644 (file)
@@ -286,6 +286,12 @@ class VectorTemplate extends BaseTemplate {
                }
        }
 
+       /**
+        * @param $name string
+        * @param $content array
+        * @param $msg null|string
+        * @param $hook null|string|array
+        */
        private function renderPortal( $name, $content, $msg = null, $hook = null ) {
                if ( $msg === null ) {
                        $msg = $name;