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

19 files changed:
includes/LinkFilter.php
includes/Namespace.php
includes/Setup.php
includes/SquidPurgeClient.php
includes/StreamFile.php
includes/Title.php
includes/User.php
includes/WikiMap.php
includes/libs/IEUrlExtension.php
includes/media/Generic.php
includes/media/MediaTransformOutput.php
includes/media/SVG.php
includes/media/XCF.php
includes/objectcache/BagOStuff.php
includes/parser/Parser.php
includes/parser/ParserCache.php
includes/revisiondelete/RevisionDeleteAbstracts.php
includes/revisiondelete/RevisionDeleteUser.php
includes/specials/SpecialDeadendpages.php

index af7680f..f1e19f9 100644 (file)
@@ -120,7 +120,7 @@ class LinkFilter {
         * Filters an array returned by makeLikeArray(), removing everything past first pattern placeholder.
         *
         * @param $arr array: array to filter
-        * @return filtered array
+        * @return array filtered array
         */
        public static function keepOneWildcard( $arr ) {
                if( !is_array( $arr ) ) {
index 292559d..e536d8b 100644 (file)
@@ -33,7 +33,7 @@ class MWNamespace {
         * @param $index
         * @param $method
         *
-        * @return true
+        * @return bool
         */
        private static function isMethodValidFor( $index, $method ) {
                if ( $index < NS_MAIN ) {
index 1cf171a..a9cf381 100644 (file)
@@ -483,7 +483,7 @@ $wgRequest->interpolateTitle();
 $wgUser = RequestContext::getMain()->getUser(); # BackCompat
 
 /**
- * @var Language
+ * @var $wgLang Language
  */
 $wgLang = new StubUserLang;
 
@@ -493,7 +493,7 @@ $wgLang = new StubUserLang;
 $wgOut = RequestContext::getMain()->getOutput(); # BackCompat
 
 /**
- * @var Parser
+ * @var $wgParser Parser
  */
 $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
 
index 506ada9..b0418ba 100644 (file)
@@ -34,7 +34,7 @@ class SquidPurgeClient {
         * Open a socket if there isn't one open already, return it.
         * Returns false on error.
         *
-        * @return false|resource
+        * @return bool|resource
         */
        protected function getSocket() {
                if ( $this->socket !== null ) {
index 0de03c8..ce13a21 100644 (file)
@@ -41,10 +41,10 @@ class StreamFile {
         * (c) sends Content-Length header based on HTTP_IF_MODIFIED_SINCE check
         *
         * @param $path string Storage path or file system path
-        * @param $info Array|false File stat info with 'mtime' and 'size' fields
+        * @param $info Array|bool File stat info with 'mtime' and 'size' fields
         * @param $headers Array Additional headers to send
         * @param $sendErrors bool Send error messages if errors occur (like 404)
-        * @return int|false READY_STREAM, NOT_MODIFIED, or false on failure
+        * @return int|bool READY_STREAM, NOT_MODIFIED, or false on failure
         */
        public static function prepareForStream(
                $path, $info, $headers = array(), $sendErrors = true
index b7eea8b..f8feb24 100644 (file)
@@ -2020,9 +2020,8 @@ class Title {
                        $name = $this->getPrefixedText();
                        $dbName = $this->getPrefixedDBKey();
 
-                       // Check with and without underscores
+                       // Check for explicit whitelisting with and without underscores
                        if ( in_array( $name, $wgWhitelistRead, true ) || in_array( $dbName, $wgWhitelistRead, true ) ) {
-                               # Check for explicit whitelisting
                                $whitelisted = true;
                        } elseif ( $this->getNamespace() == NS_MAIN ) {
                                # Old settings might have the title prefixed with
index c56e2ff..52fe08e 100644 (file)
@@ -3376,7 +3376,7 @@ class User {
         *
         * @note Call saveSettings() after calling this function to commit the change.
         *
-        * @return true
+        * @return bool
         */
        public function confirmEmail() {
                $this->setEmailAuthenticationTimestamp( wfTimestampNow() );
@@ -3389,7 +3389,7 @@ class User {
         * address if it was already confirmed.
         *
         * @note Call saveSettings() after calling this function to commit the change.
-        * @return true
+        * @return bool
         */
        function invalidateEmail() {
                $this->load();
@@ -3957,7 +3957,7 @@ class User {
         * Add an autocreate newuser log entry for this user
         * Used by things like CentralAuth and perhaps other authplugins.
         *
-        * @return true
+        * @return bool
         */
        public function addNewUserLogEntryAutoCreate() {
                global $wgNewUserLog;
index 6c7f23b..91e91f9 100644 (file)
@@ -34,7 +34,7 @@ class WikiMap {
         *
         * @todo We can give more info than just the wiki id!
         * @param $wikiID String: wiki'd id (generally database name)
-        * @return Wiki's name or $wiki_id if the wiki was not found
+        * @return string|int Wiki's name or $wiki_id if the wiki was not found
         */
        public static function getWikiName( $wikiID ) {
                $wiki = WikiMap::getWiki( $wikiID );
index e00e666..dcdf7b3 100644 (file)
@@ -35,8 +35,8 @@ class IEUrlExtension {
         *
         * If the a variable is unset in $_SERVER, it should be unset in $vars.
         *
-        * @param $vars A subset of $_SERVER.
-        * @param $extWhitelist Extensions which are allowed, assumed harmless.
+        * @param $vars array A subset of $_SERVER.
+        * @param $extWhitelist array Extensions which are allowed, assumed harmless.
         * @return bool
         */
        public static function areServerVarsBad( $vars, $extWhitelist = array() ) {
index 271d3a8..d74b1da 100644 (file)
@@ -484,7 +484,7 @@ abstract class MediaHandler {
         *
         * @param $dstPath The location of the suspect file
         * @param $retval Return value of some shell process, file will be deleted if this is non-zero
-        * @return true if removed, false otherwise
+        * @return bool if removed, false otherwise
         */
        function removeBadFile( $dstPath, $retval = 0 ) {
                if( file_exists( $dstPath ) ) {
@@ -652,7 +652,7 @@ abstract class ImageHandler extends MediaHandler {
         * @param $srcWidth Integer: width of the source image
         * @param $srcHeight Integer: height of the source image
         * @param $mimeType Unused
-        * @return false to indicate that an error should be returned to the user.
+        * @return bool to indicate that an error should be returned to the user.
         */
        function validateThumbParams( &$width, &$height, $srcWidth, $srcHeight, $mimeType ) {
                $width = intval( $width );
index fcfb2f4..ed2ba8c 100644 (file)
@@ -42,7 +42,7 @@ abstract class MediaTransformOutput {
        }
 
        /**
-        * @return string|false The permanent thumbnail storage path
+        * @return string|bool The permanent thumbnail storage path
         */
        public function getStoragePath() {
                return $this->storagePath;
@@ -113,7 +113,7 @@ abstract class MediaTransformOutput {
         * Get the path of a file system copy of the thumbnail.
         * Callers should never write to this path.
         *
-        * @return string|false Returns false if there isn't one
+        * @return string|bool Returns false if there isn't one
         */
        public function getLocalCopyPath() {
                if ( $this->isError() ) {
@@ -187,7 +187,7 @@ class ThumbnailImage extends MediaTransformOutput {
         * @param $url String: URL path to the thumb
         * @param $width Integer: file's width
         * @param $height Integer: file's height
-        * @param $path String|false|null: filesystem path to the thumb
+        * @param $path String|bool|null: filesystem path to the thumb
         * @param $page Integer: page number, for multipage files
         * @private
         */
index aac838e..5e72ab0 100644 (file)
@@ -119,7 +119,7 @@ class SvgHandler extends ImageHandler {
        * @param string $dstPath
        * @param string $width
        * @param string $height
-       * @return true|MediaTransformError
+       * @return bool|MediaTransformError
        */
        public function rasterize( $srcPath, $dstPath, $width, $height ) {
                global $wgSVGConverters, $wgSVGConverter, $wgSVGConverterPath;
index 806db73..ce71290 100644 (file)
@@ -58,7 +58,7 @@ class XCFHandler extends BitmapHandler {
         * @author Hashar
         *
         * @param $filename String Full path to a XCF file
-        * @return false|metadata array just like PHP getimagesize()
+        * @return bool|array metadata array just like PHP getimagesize()
         */
        static function getXCFMetaData( $filename ) {
                # Decode master structure
index 81ad662..6b73be7 100644 (file)
@@ -98,7 +98,7 @@ abstract class BagOStuff {
         *     regularly during long-running operations with the percentage progress
         *     as the first parameter.
         *
-        * @return true on success, false if unimplemented
+        * @return bool on success, false if unimplemented
         */
        public function deleteObjectsExpiringBefore( $date, $progressCallback = false ) {
                // stub
index 761149d..559dc9e 100644 (file)
@@ -4660,7 +4660,7 @@ class Parser {
         *     Please read the documentation in includes/parser/Preprocessor.php for more information
         *     about the methods available in PPFrame and PPNode.
         *
-        * @return The old callback function for this name, if any
+        * @return string|callback The old callback function for this name, if any
         */
        public function setFunctionHook( $id, $callback, $flags = 0 ) {
                global $wgContLang;
@@ -4891,7 +4891,7 @@ class Parser {
         *
         * @param $title Title
         * @param $options String
-        * @param $holders LinkHolderArray|false
+        * @param $holders LinkHolderArray|bool
         * @return string HTML
         */
        function makeImage( $title, $options, $holders = false ) {
index 8b04329..64a1aa0 100644 (file)
@@ -88,7 +88,7 @@ class ParserCache {
         * Retrieve the ParserOutput from ParserCache, even if it's outdated.
         * @param $article Article
         * @param $popts ParserOptions
-        * @return ParserOutput|false
+        * @return ParserOutput|bool
         */
        public function getDirty( $article, $popts ) {
                $value = $this->get( $article, $popts, true );
@@ -143,7 +143,7 @@ class ParserCache {
         * @param $popts ParserOptions
         * @param $useOutdated
         *
-        * @return ParserOutput|false
+        * @return ParserOutput|bool
         */
        public function get( $article, $popts, $useOutdated = false ) {
                global $wgCacheEpoch;
index dc7af19..ea3acdd 100644 (file)
@@ -25,7 +25,7 @@ abstract class RevDel_List extends RevisionListBase {
         * Set the visibility for the revisions in this list. Logging and
         * transactions are done here.
         *
-        * @param $params Associative array of parameters. Members are:
+        * @param $params array Associative array of parameters. Members are:
         *     value:       The integer value to set the visibility to
         *     comment:     The log comment.
         * @return Status
@@ -154,7 +154,7 @@ abstract class RevDel_List extends RevisionListBase {
 
        /**
         * Record a log entry on the action
-        * @param $params Associative array of parameters:
+        * @param $params array Associative array of parameters:
         *     newBits:         The new value of the *_deleted bitfield
         *     oldBits:         The old value of the *_deleted bitfield.
         *     title:           The target title
index c88b4d9..fe424ef 100644 (file)
@@ -30,7 +30,7 @@ class RevisionDeleteUser {
         * @param  $name String username
         * @param  $userId Int user id
         * @param  $op String operator '|' or '&'
-        * @param  $dbw null|Database, if you happen to have one lying around
+        * @param  $dbw null|DatabaseBase, if you happen to have one lying around
         * @return bool
         */
        private static function setUsernameBitfields( $name, $userId, $op, $dbw ) {
@@ -127,4 +127,4 @@ class RevisionDeleteUser {
        public static function unsuppressUserName( $name, $userId, $dbw = null ) {
                return self::setUsernameBitfields( $name, $userId, '&', $dbw );
        }
-}
\ No newline at end of file
+}
index 1266a0c..75818c9 100644 (file)
@@ -39,7 +39,7 @@ class DeadendPagesPage extends PageQueryPage {
        /**
         * LEFT JOIN is expensive
         *
-        * @return true
+        * @return bool
         */
        function isExpensive() {
                return true;
@@ -50,7 +50,7 @@ class DeadendPagesPage extends PageQueryPage {
        }
 
        /**
-        * @return false
+        * @return bool
         */
        function sortDescending() {
                return false;