From 7c6a25856c4688bc02b3c322128d570af8c880b5 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 23 Aug 2014 22:34:25 +0200 Subject: [PATCH] Add missing @return to function docs Change-Id: I45b9d02f94ecc58372268ec5e6a0b572a0b7e2a9 --- includes/EditPage.php | 1 + includes/Html.php | 3 +++ includes/MagicWord.php | 3 +++ includes/Sanitizer.php | 1 + includes/WatchedItem.php | 1 + includes/api/ApiFormatBase.php | 1 + includes/api/ApiParse.php | 1 + includes/cache/LocalisationCache.php | 1 + includes/changes/ChangesFeed.php | 1 + includes/db/Database.php | 1 + includes/db/DatabaseMysqli.php | 1 + includes/db/DatabasePostgres.php | 1 + includes/deferred/SearchUpdate.php | 1 + includes/filerepo/RepoGroup.php | 1 + includes/filerepo/file/ArchivedFile.php | 1 + includes/filerepo/file/File.php | 1 + includes/gallery/ImageGalleryBase.php | 1 + includes/gallery/PackedImageGallery.php | 1 + includes/installer/DatabaseUpdater.php | 1 + includes/installer/Installer.php | 1 + includes/logging/LogPage.php | 1 + includes/media/Exif.php | 1 + includes/page/Article.php | 1 + includes/parser/ParserOutput.php | 1 + includes/search/SearchHighlighter.php | 1 + includes/specials/SpecialListDuplicatedFiles.php | 1 + includes/specials/SpecialListfiles.php | 1 + includes/specials/SpecialMIMEsearch.php | 1 + includes/specials/SpecialPageLanguage.php | 1 + includes/specials/SpecialResetTokens.php | 1 + includes/utils/Cdb.php | 1 + includes/utils/MWCryptRand.php | 1 + 32 files changed, 36 insertions(+) diff --git a/includes/EditPage.php b/includes/EditPage.php index 70eb909cb6..9a4567d01e 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -3100,6 +3100,7 @@ HTML * Get the copyright warning * * Renamed to getCopyrightWarning(), old name kept around for backwards compatibility + * @return string */ protected function getCopywarn() { return self::getCopyrightWarning( $this->mTitle ); diff --git a/includes/Html.php b/includes/Html.php index 9e7f5c4db4..48dbdba691 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -673,6 +673,7 @@ class Html { * @param string $name Name attribute * @param bool $checked Whether the checkbox is checked or not * @param array $attribs Array of additional attributes + * @return string */ public static function check( $name, $checked = false, array $attribs = array() ) { if ( isset( $attribs['value'] ) ) { @@ -695,6 +696,7 @@ class Html { * @param string $name Name attribute * @param bool $checked Whether the checkbox is checked or not * @param array $attribs Array of additional attributes + * @return string */ public static function radio( $name, $checked = false, array $attribs = array() ) { if ( isset( $attribs['value'] ) ) { @@ -717,6 +719,7 @@ class Html { * @param string $label Contents of the label * @param string $id ID of the element being labeled * @param array $attribs Additional attributes + * @return string */ public static function label( $label, $id, array $attribs = array() ) { $attribs += array( diff --git a/includes/MagicWord.php b/includes/MagicWord.php index 7decbee0ab..4d17298b23 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -754,6 +754,7 @@ class MagicWordArray { /** * Get a 2-d hashtable for this array + * @return array */ function getHash() { if ( is_null( $this->hash ) ) { @@ -775,6 +776,7 @@ class MagicWordArray { /** * Get the base regex + * @return array */ function getBaseRegex() { if ( is_null( $this->baseRegex ) ) { @@ -799,6 +801,7 @@ class MagicWordArray { /** * Get an unanchored regex that does not match parameters + * @return array */ function getRegex() { if ( is_null( $this->regex ) ) { diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index b173ae9738..2cdbe15f2c 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -328,6 +328,7 @@ class Sanitizer { * Regular expression to match HTML/XML attribute pairs within a tag. * Allows some... latitude. * Used in Sanitizer::fixTagAttributes and Sanitizer::decodeTagAttributes + * @return string */ static function getAttribsRegex() { if ( self::$attribsRegex === null ) { diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index 93d6c0b136..d9a1e80ec7 100644 --- a/includes/WatchedItem.php +++ b/includes/WatchedItem.php @@ -164,6 +164,7 @@ class WatchedItem { /** * Check permissions * @param string $what 'viewmywatchlist' or 'editmywatchlist' + * @return bool */ private function isAllowed( $what ) { return !$this->mCheckRights || $this->mUser->isAllowed( $what ); diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index 2e3fc11014..0e3b6123d9 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -247,6 +247,7 @@ See the complete documentation, /** * Get the contents of the buffer. + * @return string */ public function getBuffer() { return $this->mBuffer; diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index d09470bd28..06fdf85bbb 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -473,6 +473,7 @@ class ApiParse extends ApiBase { /** * @param Content $content * @param string $what Identifies the content in error messages, e.g. page title. + * @return Content|bool */ private function getSectionContent( Content $content, $what ) { // Not cached (save or load) diff --git a/includes/cache/LocalisationCache.php b/includes/cache/LocalisationCache.php index e2e304a6e6..b8be6e4462 100644 --- a/includes/cache/LocalisationCache.php +++ b/includes/cache/LocalisationCache.php @@ -686,6 +686,7 @@ class LocalisationCache { * * @param string $code * @param array $deps + * @return array */ protected function readSourceFilesAndRegisterDeps( $code, &$deps ) { global $IP; diff --git a/includes/changes/ChangesFeed.php b/includes/changes/ChangesFeed.php index fb491e50b3..2d3b919dd9 100644 --- a/includes/changes/ChangesFeed.php +++ b/includes/changes/ChangesFeed.php @@ -180,6 +180,7 @@ class ChangesFeed { /** * Generate the feed items given a row from the database. * @param object $rows DatabaseBase resource with recentchanges rows + * @return array */ public static function buildItems( $rows ) { wfProfileIn( __METHOD__ ); diff --git a/includes/db/Database.php b/includes/db/Database.php index 65ae444e87..42c94f04b2 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -4201,6 +4201,7 @@ abstract class DatabaseBase implements IDatabase, DatabaseType { /** * @since 1.19 + * @return string */ public function __toString() { return (string)$this->mConn; diff --git a/includes/db/DatabaseMysqli.php b/includes/db/DatabaseMysqli.php index b8d5d7925a..2ce6307918 100644 --- a/includes/db/DatabaseMysqli.php +++ b/includes/db/DatabaseMysqli.php @@ -292,6 +292,7 @@ class DatabaseMysqli extends DatabaseMysqlBase { * Give an id for the connection * * mysql driver used resource id, but mysqli objects cannot be cast to string. + * @return string */ public function __toString() { if ( $this->mConn instanceof Mysqli ) { diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index 45fb3f68d3..44ca9de5b2 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -117,6 +117,7 @@ SQL; /** * @since 1.19 + * @return bool|mixed */ function defaultValue() { if ( $this->has_default ) { diff --git a/includes/deferred/SearchUpdate.php b/includes/deferred/SearchUpdate.php index 1466605ad4..5d084afddd 100644 --- a/includes/deferred/SearchUpdate.php +++ b/includes/deferred/SearchUpdate.php @@ -116,6 +116,7 @@ class SearchUpdate implements DeferrableUpdate { * If you're using a real search engine, you'll probably want to override * this behavior and do something nicer with the original wikitext. * @param string $text + * @return string */ public static function updateText( $text ) { global $wgContLang; diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php index 8c0c7810fb..fab4216281 100644 --- a/includes/filerepo/RepoGroup.php +++ b/includes/filerepo/RepoGroup.php @@ -406,6 +406,7 @@ class RepoGroup { /** * Create a repo class based on an info structure * @param array $info + * @return FileRepo */ protected function newRepo( $info ) { $class = $info['class']; diff --git a/includes/filerepo/file/ArchivedFile.php b/includes/filerepo/file/ArchivedFile.php index a71acdeba0..8bf90402f1 100644 --- a/includes/filerepo/file/ArchivedFile.php +++ b/includes/filerepo/file/ArchivedFile.php @@ -407,6 +407,7 @@ class ArchivedFile { /** * Returns the number of pages of a multipage document, or false for * documents which aren't multipage documents + * @return bool|int */ function pageCount() { if ( !isset( $this->pageCount ) ) { diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index f612aa3f74..4fab33b9ec 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -1331,6 +1331,7 @@ abstract class File { /** * Get last thumbnailing error. * Largely obsolete. + * @return string */ function getLastError() { return $this->lastError; diff --git a/includes/gallery/ImageGalleryBase.php b/includes/gallery/ImageGalleryBase.php index b61a3529a4..b0a593de97 100644 --- a/includes/gallery/ImageGalleryBase.php +++ b/includes/gallery/ImageGalleryBase.php @@ -87,6 +87,7 @@ abstract class ImageGalleryBase extends ContextSource { * * @param string|bool $mode Mode to use. False to use the default * @param IContextSource|null $context + * @return ImageGalleryBase * @throws MWException */ static function factory( $mode = false, IContextSource $context = null ) { diff --git a/includes/gallery/PackedImageGallery.php b/includes/gallery/PackedImageGallery.php index 207efa856e..52a49ddbc0 100644 --- a/includes/gallery/PackedImageGallery.php +++ b/includes/gallery/PackedImageGallery.php @@ -95,6 +95,7 @@ class PackedImageGallery extends TraditionalImageGallery { /** * Add javascript which auto-justifies the rows by manipulating the image sizes. * Also ensures that the hover version of this degrades gracefully. + * @return array */ protected function getModules() { return array( 'mediawiki.page.gallery' ); diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 427ded4207..b50142811d 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -984,6 +984,7 @@ abstract class DatabaseUpdater { /** * Updates the timestamps in the transcache table + * @return bool */ protected function doUpdateTranscacheField() { if ( $this->updateRowExists( 'convert transcache field' ) ) { diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 57fdab348c..33b091ba42 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -736,6 +736,7 @@ abstract class Installer { /** * Environment check for register_globals. * Prevent installation if enabled + * @return bool */ protected function envCheckRegisterGlobals() { if ( wfIniGetBool( 'register_globals' ) ) { diff --git a/includes/logging/LogPage.php b/includes/logging/LogPage.php index be7931d1ea..ce5b972fc0 100644 --- a/includes/logging/LogPage.php +++ b/includes/logging/LogPage.php @@ -184,6 +184,7 @@ class LogPage { /** * Get the comment from the last addEntry() call + * @return string */ public function getComment() { return $this->comment; diff --git a/includes/media/Exif.php b/includes/media/Exif.php index 818bb25438..018b58c5c8 100644 --- a/includes/media/Exif.php +++ b/includes/media/Exif.php @@ -563,6 +563,7 @@ class Exif { /** * Get $this->mFilteredExifData + * @return array */ function getFilteredData() { return $this->mFilteredExifData; diff --git a/includes/page/Article.php b/includes/page/Article.php index 984b01d15e..8970539934 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -1976,6 +1976,7 @@ class Article implements Page { * raw WikiPage fields for backwards compatibility. * * @param string $fname Field name + * @return mixed */ public function __get( $fname ) { if ( property_exists( $this->mPage, $fname ) ) { diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 75fc01f0fe..7fa4436b8e 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -809,6 +809,7 @@ class ParserOutput extends CacheTime { /** * Save space for for serialization by removing useless values + * @return array */ public function __sleep() { return array_diff( diff --git a/includes/search/SearchHighlighter.php b/includes/search/SearchHighlighter.php index 7e5f685930..0bd6ca83d5 100644 --- a/includes/search/SearchHighlighter.php +++ b/includes/search/SearchHighlighter.php @@ -483,6 +483,7 @@ class SearchHighlighter { * the target is category or image, leave it * * @param array $matches + * @return string */ function linkReplace( $matches ) { $colon = strpos( $matches[1], ':' ); diff --git a/includes/specials/SpecialListDuplicatedFiles.php b/includes/specials/SpecialListDuplicatedFiles.php index c1dc158a30..26672706b8 100644 --- a/includes/specials/SpecialListDuplicatedFiles.php +++ b/includes/specials/SpecialListDuplicatedFiles.php @@ -51,6 +51,7 @@ class ListDuplicatedFilesPage extends QueryPage { * However this version should be no more expensive then * Special:MostLinked, which seems to get handled fine * with however we are doing cached special pages. + * @return array */ function getQueryInfo() { return array( diff --git a/includes/specials/SpecialListfiles.php b/includes/specials/SpecialListfiles.php index ed7648d735..b5c763f028 100644 --- a/includes/specials/SpecialListfiles.php +++ b/includes/specials/SpecialListfiles.php @@ -301,6 +301,7 @@ class ImageListPager extends TablePager { * @param int $offset * @param int $limit * @param bool $asc + * @return array */ function reallyDoQuery( $offset, $limit, $asc ) { $prevTableName = $this->mTableName; diff --git a/includes/specials/SpecialMIMEsearch.php b/includes/specials/SpecialMIMEsearch.php index 3f1850d128..3215778862 100644 --- a/includes/specials/SpecialMIMEsearch.php +++ b/includes/specials/SpecialMIMEsearch.php @@ -99,6 +99,7 @@ class MIMEsearchPage extends QueryPage { * that this report gives results in a logical order). As an aditional * note, mysql seems to by default order things by img_name ASC, which * is what we ideally want, so everything works out fine anyhow. + * @return array */ function getOrderFields() { return array(); diff --git a/includes/specials/SpecialPageLanguage.php b/includes/specials/SpecialPageLanguage.php index 6e04762989..5c8794ae99 100644 --- a/includes/specials/SpecialPageLanguage.php +++ b/includes/specials/SpecialPageLanguage.php @@ -97,6 +97,7 @@ class SpecialPageLanguage extends FormSpecialPage { /** * * @param array $data + * @return bool */ public function onSubmit( array $data ) { $title = Title::newFromText( $data['pagename'] ); diff --git a/includes/specials/SpecialResetTokens.php b/includes/specials/SpecialResetTokens.php index 6c5401ac23..4add742117 100644 --- a/includes/specials/SpecialResetTokens.php +++ b/includes/specials/SpecialResetTokens.php @@ -77,6 +77,7 @@ class SpecialResetTokens extends FormSpecialPage { /** * Display appropriate message if there's nothing to do. * The submit button is also suppressed in this case (see alterForm()). + * @return array */ protected function getFormFields() { $user = $this->getUser(); diff --git a/includes/utils/Cdb.php b/includes/utils/Cdb.php index b97e2ad31e..3ceb620f67 100644 --- a/includes/utils/Cdb.php +++ b/includes/utils/Cdb.php @@ -148,6 +148,7 @@ abstract class CdbWriter { /** * Are we running on Windows? + * @return bool */ protected function isWindows() { return substr( php_uname(), 0, 7 ) == 'Windows'; diff --git a/includes/utils/MWCryptRand.php b/includes/utils/MWCryptRand.php index 31a71c4af9..b602f78e2c 100644 --- a/includes/utils/MWCryptRand.php +++ b/includes/utils/MWCryptRand.php @@ -61,6 +61,7 @@ class MWCryptRand { /** * Initialize an initial random state based off of whatever we can find + * @return string */ protected function initialRandomState() { // $_SERVER contains a variety of unstable user and system specific information -- 2.20.1