From 85bbb0b080cc721093088f15913aada1043db04c Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Thu, 9 Feb 2012 18:01:10 +0000 Subject: [PATCH] Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar Other documentation improvements --- includes/HTMLForm.php | 2 +- includes/HttpFunctions.php | 4 ---- includes/IP.php | 2 +- includes/Linker.php | 2 +- includes/MagicWord.php | 4 ++-- includes/OutputPage.php | 6 +++--- includes/Pager.php | 2 +- includes/PathRouter.php | 8 ++++---- includes/Skin.php | 2 +- includes/SkinTemplate.php | 2 +- includes/SpecialPage.php | 8 ++++---- includes/Title.php | 2 +- includes/User.php | 4 ++-- includes/UserMailer.php | 2 +- includes/WebRequest.php | 2 +- includes/WikiPage.php | 6 +++--- includes/Xml.php | 4 ++-- includes/installer/PostgresInstaller.php | 19 ++++++++++--------- includes/logging/LogEntry.php | 2 +- includes/logging/LogEventsList.php | 2 +- includes/media/BitmapMetadataHandler.php | 2 +- includes/media/GIFMetadataExtractor.php | 2 +- includes/media/Generic.php | 4 ++-- includes/parser/Parser.php | 4 ++-- includes/parser/Preprocessor_Hash.php | 2 +- .../RevisionDeleteAbstracts.php | 2 +- includes/revisiondelete/RevisionDeleter.php | 2 +- includes/search/SearchEngine.php | 4 ++-- .../specials/SpecialDeletedContributions.php | 3 +-- .../specials/SpecialMostlinkedtemplates.php | 2 +- includes/specials/SpecialRecentchanges.php | 2 +- 31 files changed, 55 insertions(+), 59 deletions(-) diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index a5ff8cd760..678babc3bb 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -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; diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 147823fee7..8a8249aac9 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -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 ) { diff --git a/includes/IP.php b/includes/IP.php index e3f6121422..e1c1f6d0a6 100644 --- a/includes/IP.php +++ b/includes/IP.php @@ -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 ) { diff --git a/includes/Linker.php b/includes/Linker.php index a0da2af770..15a91c19bf 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -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 * diff --git a/includes/MagicWord.php b/includes/MagicWord.php index 1ba4670181..14ca4a0425 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -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(); diff --git a/includes/OutputPage.php b/includes/OutputPage.php index b42732b558..972369024f 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -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 ) { diff --git a/includes/Pager.php b/includes/Pager.php index 7945587a80..9af0ceaf77 100644 --- a/includes/Pager.php +++ b/includes/Pager.php @@ -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 ) ) { diff --git a/includes/PathRouter.php b/includes/PathRouter.php index 4c9b2a8431..53ddd425e0 100644 --- a/includes/PathRouter.php +++ b/includes/PathRouter.php @@ -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 ) { diff --git a/includes/Skin.php b/includes/Skin.php index 2774869462..4d015eb7fb 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -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; diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index d315d72b2f..ab254d2c29 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -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 ) { diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 17a36ecf10..749b1c54bd 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -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 ); diff --git a/includes/Title.php b/includes/Title.php index f8feb2441e..b5f9db40a9 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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 ) { diff --git a/includes/User.php b/includes/User.php index 52fe08ef25..0eead0e83e 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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 ); diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 66bb58deb0..fe01a8b137 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -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 diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 39f9cb8e62..cd0fd20ca7 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -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(); diff --git a/includes/WikiPage.php b/includes/WikiPage.php index acc9831aa5..9cf031f52c 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -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 */ diff --git a/includes/Xml.php b/includes/Xml.php index 7e5b3cdba9..6797e64dac 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -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 diff --git a/includes/installer/PostgresInstaller.php b/includes/installer/PostgresInstaller.php index fea012e26a..eb9ba2893c 100644 --- a/includes/installer/PostgresInstaller.php +++ b/includes/installer/PostgresInstaller.php @@ -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 A 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 ) { diff --git a/includes/logging/LogEntry.php b/includes/logging/LogEntry.php index c6f717b4e4..b28a24d415 100644 --- a/includes/logging/LogEntry.php +++ b/includes/logging/LogEntry.php @@ -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; diff --git a/includes/logging/LogEventsList.php b/includes/logging/LogEventsList.php index 437670d013..8ff4678126 100644 --- a/includes/logging/LogEventsList.php +++ b/includes/logging/LogEventsList.php @@ -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 diff --git a/includes/media/BitmapMetadataHandler.php b/includes/media/BitmapMetadataHandler.php index 746dddda4f..1a4da35dcf 100644 --- a/includes/media/BitmapMetadataHandler.php +++ b/includes/media/BitmapMetadataHandler.php @@ -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 ) { diff --git a/includes/media/GIFMetadataExtractor.php b/includes/media/GIFMetadataExtractor.php index 5dbeb8f852..90bc726848 100644 --- a/includes/media/GIFMetadataExtractor.php +++ b/includes/media/GIFMetadataExtractor.php @@ -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 = ''; diff --git a/includes/media/Generic.php b/includes/media/Generic.php index d74b1da1e0..5349ade486 100644 --- a/includes/media/Generic.php +++ b/includes/media/Generic.php @@ -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 ) { diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 559dc9e08f..80a65123aa 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -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 diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php index 2934181a50..9453b90f4f 100644 --- a/includes/parser/Preprocessor_Hash.php +++ b/includes/parser/Preprocessor_Hash.php @@ -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 */ diff --git a/includes/revisiondelete/RevisionDeleteAbstracts.php b/includes/revisiondelete/RevisionDeleteAbstracts.php index ea3acdd28e..c961439baf 100644 --- a/includes/revisiondelete/RevisionDeleteAbstracts.php +++ b/includes/revisiondelete/RevisionDeleteAbstracts.php @@ -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 ) { diff --git a/includes/revisiondelete/RevisionDeleter.php b/includes/revisiondelete/RevisionDeleter.php index a5a391815b..8f85ae3df8 100644 --- a/includes/revisiondelete/RevisionDeleter.php +++ b/includes/revisiondelete/RevisionDeleter.php @@ -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 ) { diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index 2f7dfd7ee5..aeacbad0a6 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -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; diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index 0581867536..47e2e218be 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -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 ) { diff --git a/includes/specials/SpecialMostlinkedtemplates.php b/includes/specials/SpecialMostlinkedtemplates.php index 6fb094260b..72dc15bbb8 100644 --- a/includes/specials/SpecialMostlinkedtemplates.php +++ b/includes/specials/SpecialMostlinkedtemplates.php @@ -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 ) { diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 06a8a0ce32..c58aba1ade 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -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' ); -- 2.20.1