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

31 files changed:
includes/HTMLForm.php
includes/HttpFunctions.php
includes/IP.php
includes/Linker.php
includes/MagicWord.php
includes/OutputPage.php
includes/Pager.php
includes/PathRouter.php
includes/Skin.php
includes/SkinTemplate.php
includes/SpecialPage.php
includes/Title.php
includes/User.php
includes/UserMailer.php
includes/WebRequest.php
includes/WikiPage.php
includes/Xml.php
includes/installer/PostgresInstaller.php
includes/logging/LogEntry.php
includes/logging/LogEventsList.php
includes/media/BitmapMetadataHandler.php
includes/media/GIFMetadataExtractor.php
includes/media/Generic.php
includes/parser/Parser.php
includes/parser/Preprocessor_Hash.php
includes/revisiondelete/RevisionDeleteAbstracts.php
includes/revisiondelete/RevisionDeleter.php
includes/search/SearchEngine.php
includes/specials/SpecialDeletedContributions.php
includes/specials/SpecialMostlinkedtemplates.php
includes/specials/SpecialRecentchanges.php

index a5ff8cd..678babc 100644 (file)
@@ -874,7 +874,7 @@ class HTMLForm extends ContextSource {
         *
         * @since 1.19
         *
-        * @param string|false $action
+        * @param string|bool $action
         */
        public function setAction( $action ) {
                $this->mAction = $action;
index 147823f..8a8249a 100644 (file)
@@ -417,8 +417,6 @@ class MWHttpRequest {
         * Parses the headers, including the HTTP status code and any
         * Set-Cookie headers.  This function expectes the headers to be
         * found in an array in the member variable headerList.
-        *
-        * @return nothing
         */
        protected function parseHeader() {
                $lastname = "";
@@ -446,8 +444,6 @@ class MWHttpRequest {
         * RFC2616, section 10,
         * http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for a
         * list of status codes.)
-        *
-        * @return nothing
         */
        protected function setStatus() {
                if ( !$this->respHeaders ) {
index e3f6121..e1c1f6d 100644 (file)
@@ -198,7 +198,7 @@ class IP {
         *
         * A bare IPv6 address is accepted despite the lack of square brackets.
         *
-        * @param $both The string with the host and port
+        * @param $both string The string with the host and port
         * @return array
         */
        public static function splitHostAndPort( $both ) {
index a0da2af..15a91c1 100644 (file)
@@ -848,7 +848,7 @@ class Linker {
         * This will make a broken link if $file is false.
         *
         * @param $title Title object.
-        * @param $file File|false mixed File object or false
+        * @param $file File|bool mixed File object or false
         * @param $html String: pre-sanitized HTML
         * @return String: HTML
         *
index 1ba4670..14ca4a0 100644 (file)
@@ -813,7 +813,7 @@ class MagicWordArray {
         *
         * @param $text string
         *
-        * @return string|false
+        * @return string|bool
         */
        public function matchStartToEnd( $text ) {
                $hash = $this->getHash();
@@ -861,7 +861,7 @@ class MagicWordArray {
         *
         * @param $text string
         *
-        * @return int|false
+        * @return int|bool
         */
        public function matchStartAndRemove( &$text ) {
                $regexes = $this->getRegexStart();
index b42732b..9723690 100644 (file)
@@ -1075,7 +1075,7 @@ class OutputPage extends ContextSource {
        /**
         * Add new language links
         *
-        * @param $newLinkArray Associative array mapping language code to the page
+        * @param $newLinkArray array Associative array mapping language code to the page
         *                      name
         */
        public function addLanguageLinks( $newLinkArray ) {
@@ -1085,7 +1085,7 @@ class OutputPage extends ContextSource {
        /**
         * Reset the language links and add new language links
         *
-        * @param $newLinkArray Associative array mapping language code to the page
+        * @param $newLinkArray array Associative array mapping language code to the page
         *                      name
         */
        public function setLanguageLinks( $newLinkArray ) {
@@ -1366,7 +1366,7 @@ class OutputPage extends ContextSource {
        /**
         * Set the displayed file version
         *
-        * @param $file File|false
+        * @param $file File|bool
         * @return Mixed: previous value
         */
        public function setFileVersion( $file ) {
index 7945587..9af0cea 100644 (file)
@@ -433,7 +433,7 @@ abstract class IndexPager extends ContextSource implements Pager {
         * By default, all parameters passed in the URL are used, except for a
         * short blacklist.
         *
-        * @return Associative array
+        * @return array Associative array
         */
        function getDefaultQuery() {
                if ( !isset( $this->mDefaultQuery ) ) {
index 4c9b2a8..53ddd42 100644 (file)
@@ -123,9 +123,9 @@ class PathRouter {
        /**
         * Add a new path pattern to the path router
         *
-        * @param $path The path pattern to add
-        * @param $params The params for this path pattern
-        * @param $options The options for this path pattern
+        * @param $path string The path pattern to add
+        * @param $params array The params for this path pattern
+        * @param $options array The options for this path pattern
         */
        public function add( $path, $params = array(), $options = array() ) {
                if ( is_array( $path ) ) {
@@ -195,7 +195,7 @@ class PathRouter {
        /**
         * Parse a path and return the query matches for the path
         *
-        * @param $path The path to parse
+        * @param $path string The path to parse
         * @return Array The array of matches for the path
         */
        public function parse( $path ) {
index 2774869..4d015eb 100644 (file)
@@ -22,7 +22,7 @@ abstract class Skin extends ContextSource {
 
        /**
         * Fetch the set of available skins.
-        * @return associative array of strings
+        * @return array associative array of strings
         */
        static function getSkinNames() {
                global $wgValidSkinNames;
index d315d72..ab254d2 100644 (file)
@@ -1345,7 +1345,7 @@ abstract class BaseTemplate extends QuickTemplate {
        /**
         * Get a Message object with its context set
         *
-        * @param $name Str message name
+        * @param $name string message name
         * @return Message
         */
        public function getMsg( $name ) {
index 17a36ec..749b1c5 100644 (file)
@@ -200,7 +200,7 @@ class SpecialPage {
         *
         * @param $user User object to check permissions, $wgUser will be used
         *              if not provided
-        * @return Associative array mapping page's name to its SpecialPage object
+        * @return array Associative array mapping page's name to its SpecialPage object
         * @deprecated since 1.18 call SpecialPageFactory method directly
         */
        static function getUsablePages( User $user = null ) {
@@ -211,7 +211,7 @@ class SpecialPage {
        /**
         * Return categorised listable special pages for all users
         *
-        * @return Associative array mapping page's name to its SpecialPage object
+        * @return array Associative array mapping page's name to its SpecialPage object
         * @deprecated since 1.18 call SpecialPageFactory method directly
         */
        static function getRegularPages() {
@@ -223,7 +223,7 @@ class SpecialPage {
         * Return categorised listable special pages which are available
         * for the current user, but not for everyone
         *
-        * @return Associative array mapping page's name to its SpecialPage object
+        * @return array Associative array mapping page's name to its SpecialPage object
         * @deprecated since 1.18 call SpecialPageFactory method directly
         */
        static function getRestrictedPages() {
@@ -988,7 +988,7 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage {
         * False otherwise.
         *
         * @param $par String Subpage string
-        * @return Title|false
+        * @return Title|bool
         */
        abstract public function getRedirect( $par );
 
index f8feb24..b5f9db4 100644 (file)
@@ -260,7 +260,7 @@ class Title {
         * Load Title object fields from a DB row.
         * If false is given, the title will be treated as non-existing.
         *
-        * @param $row Object|false database row
+        * @param $row Object|bool database row
         * @return void
         */
        public function loadFromRow( $row ) {
index 52fe08e..0eead0e 100644 (file)
@@ -445,7 +445,7 @@ class User {
        /**
         * Get the username corresponding to a given user ID
         * @param $id Int User ID
-        * @return String|false The corresponding username
+        * @return String|bool The corresponding username
         */
        public static function whoIs( $id ) {
                $dbr = wfGetDB( DB_SLAVE );
@@ -456,7 +456,7 @@ class User {
         * Get the real name of a user given their user ID
         *
         * @param $id Int User ID
-        * @return String|false The corresponding user's real name
+        * @return String|bool The corresponding user's real name
         */
        public static function whoIsReal( $id ) {
                $dbr = wfGetDB( DB_SLAVE );
index 66bb58d..fe01a8b 100644 (file)
@@ -109,7 +109,7 @@ class UserMailer {
        /**
         * Creates a single string from an associative array
         *
-        * @param $headers Associative Array: keys are header field names,
+        * @param $headers array Associative Array: keys are header field names,
         *                 values are ... values.
         * @param $endl String: The end of line character.  Defaults to "\n"
         * @return String
index 39f9cb8..cd0fd20 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|false
+        * @return string|bool
         */
        public function getHeader( $name ) {
                $this->initHeaders();
index acc9831..9cf031f 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|false The text of the current revision
+        * @return String|bool The text of the current revision
         */
        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|false The text of the current revision
+        * @return String|bool The text of the current revision
         */
        public function getRawText() {
                $this->loadLastEdit();
@@ -1059,7 +1059,7 @@ class WikiPage extends Page {
         * If the given revision is newer than the currently set page_latest,
         * update the page record. Otherwise, do nothing.
         *
-        * @param $dbw Database object
+        * @param $dbw DatabaseBase object
         * @param $revision Revision object
         * @return mixed
         */
index 7e5b3cd..6797e64 100644 (file)
@@ -254,8 +254,8 @@ class Xml {
 
        /**
         * Shortcut to make a specific element with a class attribute
-        * @param $text content of the element, will be escaped
-        * @param $class class name of the span element
+        * @param $text string content of the element, will be escaped
+        * @param $class string class name of the span element
         * @param $tag string element name
         * @param $attribs array other attributes
         * @return string
index fea012e..eb9ba28 100644 (file)
@@ -110,9 +110,9 @@ class PostgresInstaller extends DatabaseInstaller {
 
        /**
         * Open a PG connection with given parameters
-        * @param $user User name
-        * @param $password Password
-        * @param $dbName Database name
+        * @param $user string User name
+        * @param $password string Password
+        * @param $dbName string Database name
         * @return Status
         */
        protected function openConnectionWithParams( $user, $password, $dbName ) {
@@ -168,14 +168,14 @@ class PostgresInstaller extends DatabaseInstaller {
         * separate connection for this allows us to avoid accidental cross-module
         * dependencies.
         *
-        * @param $type The type of connection to get:
+        * @param $type string The type of connection to get:
         *    - create-db:     A connection for creating DBs, suitable for pre-
         *                     installation.
         *    - create-schema: A connection to the new DB, for creating schemas and
         *                     other similar objects in the new DB.
         *    - create-tables: A connection with a role suitable for creating tables.
         *
-        * @return Status object. On success, a connection object will be in the
+        * @return Status object. On success, a connection object will be in the
         *   value member.
         */
        protected function openPgConnection( $type ) {
@@ -365,10 +365,11 @@ class PostgresInstaller extends DatabaseInstaller {
 
        /**
         * Recursive helper for canCreateObjectsForWebUser().
-        * @param $conn Database object
-        * @param $targetMember Role ID of the member to look for
-        * @param $group Role ID of the group to look for
-        * @param $maxDepth Maximum recursive search depth
+        * @param $conn DatabaseBase object
+        * @param $targetMember int Role ID of the member to look for
+        * @param $group int Role ID of the group to look for
+        * @param $maxDepth int Maximum recursive search depth
+        * @return bool
         */
        protected function isRoleMember( $conn, $targetMember, $group, $maxDepth ) {
                if ( $targetMember === $group ) {
index c6f717b..b28a24d 100644 (file)
@@ -344,7 +344,7 @@ class ManualLogEntry extends LogEntryBase {
         * 
         * @since 1.19
         * 
-        * @param $parameters Associative array
+        * @param $parameters array Associative array
         */
        public function setParameters( $parameters ) {
                $this->parameters = $parameters;
index 437670d..8ff4678 100644 (file)
@@ -606,7 +606,7 @@ class LogEventsList {
         * @param $types String|Array Log types to show
         * @param $page String|Title The page title to show log entries for
         * @param $user String The user who made the log entries
-        * @param $param Associative Array with the following additional options:
+        * @param $param array Associative Array with the following additional options:
         * - lim Integer Limit of items to show, default is 50
         * - conds Array Extra conditions for the query (e.g. "log_action != 'revision'")
         * - showIfEmpty boolean Set to false if you don't want any output in case the loglist is empty
index 746dddd..1a4da35 100644 (file)
@@ -193,7 +193,7 @@ class BitmapMetadataHandler {
         * They don't really have native metadata, so just merges together
         * XMP and image comment.
         *
-        * @param $filename full path to file
+        * @param $filename string full path to file
         * @return Array metadata array
         */
        static public function GIF ( $filename ) {
index 5dbeb8f..90bc726 100644 (file)
@@ -286,7 +286,7 @@ class GIFMetadataExtractor {
         *  sub-blocks in the returned value. Normally this is false,
         *  except XMP is weird and does a hack where you need to keep
         *  these length bytes.
-        * @return The data.
+        * @return string The data.
         */
        static function readBlock( $fh, $includeLengths = false ) {
                $data = '';
index d74b1da..5349ade 100644 (file)
@@ -482,8 +482,8 @@ abstract class MediaHandler {
         * Check for zero-sized thumbnails. These can be generated when
         * no disk space is available or some other error occurs
         *
-        * @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
+        * @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
         */
        function removeBadFile( $dstPath, $retval = 0 ) {
index 559dc9e..80a6512 100644 (file)
@@ -616,7 +616,7 @@ class Parser {
        /**
         * Accessor/mutator for the Title object
         *
-        * @param $x New Title object or null to just get the current one
+        * @param $x Title object or null to just get the current one
         * @return Title object
         */
        function Title( $x = null ) {
@@ -3671,7 +3671,7 @@ class Parser {
         * Return the text to be used for a given extension tag.
         * This is the ghost of strip().
         *
-        * @param $params Associative array of parameters:
+        * @param $params array Associative array of parameters:
         *     name       PPNode for the tag name
         *     attr       PPNode for unparsed text where tag attributes are thought to be
         *     attributes Optional associative array of parsed attributes
index 2934181..9453b90 100644 (file)
@@ -869,7 +869,7 @@ class PPFrame_Hash implements PPFrame {
         * $args is optionally a multi-root PPNode or array containing the template arguments
         *
         * @param $args PPNode_Hash_Array|array
-        * @param $title Title|false
+        * @param $title Title|bool
         *
         * @return PPTemplateFrame_Hash
         */
index ea3acdd..c961439 100644 (file)
@@ -196,7 +196,7 @@ abstract class RevDel_List extends RevisionListBase {
 
        /**
         * Get log parameter array.
-        * @param $params Associative array of log parameters, same as updateLog()
+        * @param $params array Associative array of log parameters, same as updateLog()
         * @return array
         */
        public function getLogParams( $params ) {
index a5a3918..8f85ae3 100644 (file)
@@ -43,7 +43,7 @@ class RevisionDeleter {
         *
         * @param $n Integer: the new bitfield.
         * @param $o Integer: the old bitfield.
-        * @return An array as described above.
+        * @return array An array as described above.
         * @since 1.19 public
         */
        public static function getChanges( $n, $o ) {
index 2f7dfd7..aeacbad 100644 (file)
@@ -91,7 +91,7 @@ class SearchEngine {
         * @since 1.18
         * @param $feature String
         * @param $data Mixed
-        * @return Noolean
+        * @return bool
         */
        public function setFeatureData( $feature, $data ) {
                $this->features[$feature] = $data;
@@ -771,7 +771,7 @@ class SearchResult {
        }
 
        /**
-        * @return Double or null if not supported
+        * @return Double|null if not supported
         */
        function getScore() {
                return null;
index 0581867..47e2e21 100644 (file)
@@ -237,7 +237,7 @@ class DeletedContribsPager extends IndexPager {
        /**
         * Get the Database object in use
         *
-        * @return Database
+        * @return DatabaseBase
         */
        public function getDatabase() {
                return $this->mDb;
@@ -254,7 +254,6 @@ class DeletedContributionsPage extends SpecialPage {
         * Special page "deleted user contributions".
         * Shows a list of the deleted contributions of a user.
         *
-        * @return      none
         * @param       $par    String: (optional) user name of the user for which to show the contributions
         */
        function execute( $par ) {
index 6fb0942..72dc15b 100644 (file)
@@ -75,7 +75,7 @@ class MostlinkedTemplatesPage extends QueryPage {
        /**
         * Pre-cache page existence to speed up link generation
         *
-        * @param $db Database connection
+        * @param $db DatabaseBase connection
         * @param $res ResultWrapper
         */
        public function preprocessResults( $db, $res ) {
index 06a8a0c..c58aba1 100644 (file)
@@ -366,7 +366,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
         *
         * @param $conds Array
         * @param $opts FormOptions
-        * @return database result or false (for Recentchangeslinked only)
+        * @return bool|ResultWrapper result or false (for Recentchangeslinked only)
         */
        public function doMainQuery( $conds, $opts ) {
                $tables = array( 'recentchanges' );