From 09a78c1368a5ad2feb75ba9c66ce4374b1359cc7 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Thu, 9 Feb 2012 21:36:14 +0000 Subject: [PATCH] More return documentation --- includes/QueryPage.php | 7 +++++++ includes/Revision.php | 4 ++++ includes/RevisionList.php | 14 ++++++++++++++ includes/Skin.php | 1 + includes/SkinLegacy.php | 7 ++++++- includes/SkinTemplate.php | 8 ++++++++ includes/SpecialPageFactory.php | 1 + includes/Status.php | 2 ++ includes/StubObject.php | 2 ++ includes/Title.php | 3 +++ includes/UserMailer.php | 2 ++ includes/UserRightsProxy.php | 1 + includes/WikiFilePage.php | 1 + includes/WikiPage.php | 5 +++++ includes/Xml.php | 1 + includes/ZipDirectoryReader.php | 3 +++ includes/revisiondelete/RevisionDelete.php | 3 +++ .../revisiondelete/RevisionDeleteAbstracts.php | 3 +++ includes/search/SearchEngine.php | 6 ++++++ includes/search/SearchIBM_DB2.php | 5 ++++- includes/search/SearchMssql.php | 7 ++++++- includes/search/SearchMySQL.php | 3 +++ includes/search/SearchOracle.php | 2 ++ includes/search/SearchPostgres.php | 1 + includes/search/SearchSqlite.php | 1 + includes/specials/SpecialAllmessages.php | 1 + includes/specials/SpecialAllpages.php | 2 ++ includes/specials/SpecialBlock.php | 1 + includes/specials/SpecialBooksources.php | 1 + includes/specials/SpecialContributions.php | 3 +++ includes/specials/SpecialDeletedContributions.php | 2 ++ includes/specials/SpecialExport.php | 1 + includes/specials/SpecialFewestrevisions.php | 1 + includes/specials/SpecialJavaScriptTest.php | 1 + includes/specials/SpecialLinkSearch.php | 2 ++ includes/specials/SpecialPrefixindex.php | 3 ++- includes/specials/SpecialProtectedtitles.php | 1 + includes/specials/SpecialRecentchanges.php | 3 +++ includes/specials/SpecialRevisiondelete.php | 3 +++ includes/specials/SpecialUnblock.php | 1 + includes/specials/SpecialUnusedcategories.php | 1 + includes/specials/SpecialUploadStash.php | 4 ++++ includes/specials/SpecialUserlogin.php | 8 ++++++++ includes/specials/SpecialVersion.php | 2 ++ includes/specials/SpecialWantedfiles.php | 1 + includes/upload/UploadBase.php | 7 +++++++ includes/upload/UploadFromChunks.php | 2 ++ includes/upload/UploadFromFile.php | 2 ++ includes/upload/UploadFromUrl.php | 4 ++++ includes/upload/UploadStash.php | 1 + 50 files changed, 147 insertions(+), 4 deletions(-) diff --git a/includes/QueryPage.php b/includes/QueryPage.php index 3383551b8b..4cad43eb3f 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -259,6 +259,7 @@ abstract class QueryPage extends SpecialPage { * Setting this to return true will ensure formatResult() is called * one more time to make sure that the very last result is formatted * as well. + * @return bool */ function tryLastResult() { return false; @@ -269,6 +270,7 @@ abstract class QueryPage extends SpecialPage { * * @param $limit Integer: limit for SQL statement * @param $ignoreErrors Boolean: whether to ignore database errors + * @return bool|int */ function recache( $limit, $ignoreErrors = true ) { if ( !$this->isCacheable() ) { @@ -382,6 +384,7 @@ abstract class QueryPage extends SpecialPage { /** * Somewhat deprecated, you probably want to be using execute() + * @return \ResultWrapper */ function doQuery( $offset = false, $limit = false ) { if ( $this->isCached() && $this->isCacheable() ) { @@ -435,6 +438,7 @@ abstract class QueryPage extends SpecialPage { /** * This is the actual workhorse. It does everything needed to make a * real, honest-to-gosh query page. + * @return int */ function execute( $par ) { global $wgQueryCacheLimit, $wgDisableQueryPageUpdate; @@ -621,6 +625,7 @@ abstract class QueryPage extends SpecialPage { /** * Similar to above, but packaging in a syndicated feed instead of a web page + * @return bool */ function doFeed( $class = '', $limit = 50 ) { global $wgFeed, $wgFeedClasses; @@ -660,6 +665,7 @@ abstract class QueryPage extends SpecialPage { /** * Override for custom handling. If the titles/links are ok, just do * feedItemDesc() + * @return FeedItem|null */ function feedResult( $row ) { if ( !isset( $row->title ) ) { @@ -745,6 +751,7 @@ abstract class WantedQueryPage extends QueryPage { * kluge for Special:WantedFiles, which may contain false * positives for files that exist e.g. in a shared repo (bug * 6220). + * @return bool */ function forceExistenceCheck() { return false; diff --git a/includes/Revision.php b/includes/Revision.php index 445211c9b9..f8e68900e7 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -321,6 +321,7 @@ class Revision { /** * Return the list of revision fields that should be selected to create * a new revision. + * @return array */ public static function selectFields() { return array( @@ -342,6 +343,7 @@ class Revision { /** * Return the list of text fields that should be selected to read the * revision text + * @return array */ public static function selectTextFields() { return array( @@ -352,6 +354,7 @@ class Revision { /** * Return the list of page fields that should be selected from page table + * @return array */ public static function selectPageFields() { return array( @@ -364,6 +367,7 @@ class Revision { /** * Return the list of user fields that should be selected from user table + * @return array */ public static function selectUserFields() { return array( 'user_name' ); diff --git a/includes/RevisionList.php b/includes/RevisionList.php index 814e2dfa80..ccd2570026 100644 --- a/includes/RevisionList.php +++ b/includes/RevisionList.php @@ -31,6 +31,7 @@ abstract class RevisionListBase extends ContextSource { /** * Get the internal type name of this list. Equal to the table name. * Override this function. + * @return null */ public function getType() { return null; @@ -80,6 +81,7 @@ abstract class RevisionListBase extends ContextSource { /** * Get the number of items in the list. + * @return int */ public function length() { if( !$this->res ) { @@ -124,6 +126,7 @@ abstract class RevisionItemBase { /** * Get the DB field name associated with the ID list. * Override this function. + * @return null */ public function getIdField() { return null; @@ -132,6 +135,7 @@ abstract class RevisionItemBase { /** * Get the DB field name storing timestamps. * Override this function. + * @return bool */ public function getTimestampField() { return false; @@ -140,6 +144,7 @@ abstract class RevisionItemBase { /** * Get the DB field name storing user ids. * Override this function. + * @return bool */ public function getAuthorIdField() { return false; @@ -148,6 +153,7 @@ abstract class RevisionItemBase { /** * Get the DB field name storing user names. * Override this function. + * @return bool */ public function getAuthorNameField() { return false; @@ -155,6 +161,7 @@ abstract class RevisionItemBase { /** * Get the ID, as it would appear in the ids URL parameter + * @return */ public function getId() { $field = $this->getIdField(); @@ -163,6 +170,7 @@ abstract class RevisionItemBase { /** * Get the date, formatted in user's languae + * @return String */ public function formatDate() { return $this->list->getLanguage()->userDate( $this->getTimestamp(), @@ -171,6 +179,7 @@ abstract class RevisionItemBase { /** * Get the time, formatted in user's languae + * @return String */ public function formatTime() { return $this->list->getLanguage()->userTime( $this->getTimestamp(), @@ -179,6 +188,7 @@ abstract class RevisionItemBase { /** * Get the timestamp in MW 14-char form + * @return Mixed */ public function getTimestamp() { $field = $this->getTimestampField(); @@ -187,6 +197,7 @@ abstract class RevisionItemBase { /** * Get the author user ID + * @return int */ public function getAuthorId() { $field = $this->getAuthorIdField(); @@ -195,6 +206,7 @@ abstract class RevisionItemBase { /** * Get the author user name + * @return string */ public function getAuthorName() { $field = $this->getAuthorNameField(); @@ -292,6 +304,7 @@ class RevisionItem extends RevisionItemBase { /** * Get the HTML link to the revision text. * Overridden by RevDel_ArchiveItem. + * @return string */ protected function getRevisionLink() { $date = $this->list->getLanguage()->timeanddate( $this->revision->getTimestamp(), true ); @@ -312,6 +325,7 @@ class RevisionItem extends RevisionItemBase { /** * Get the HTML link to the diff. * Overridden by RevDel_ArchiveItem + * @return string */ protected function getDiffLink() { if ( $this->isDeleted() && !$this->canViewContent() ) { diff --git a/includes/Skin.php b/includes/Skin.php index 908a4c9e41..8cf1e78cb4 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1540,6 +1540,7 @@ abstract class Skin extends ContextSource { * * @param $fname String Name of called method * @param $args Array Arguments to the method + * @return mixed */ function __call( $fname, $args ) { $realFunction = array( 'Linker', $fname ); diff --git a/includes/SkinLegacy.php b/includes/SkinLegacy.php index 77c85a88cb..03ae3a44f3 100644 --- a/includes/SkinLegacy.php +++ b/includes/SkinLegacy.php @@ -84,6 +84,7 @@ class LegacyTemplate extends BaseTemplate { /** * This will be called immediately after the tag. Split into * two functions to make it easier to subclass. + * @return string */ function beforeContent() { return $this->doBeforeContent(); @@ -152,7 +153,9 @@ class LegacyTemplate extends BaseTemplate { return $this->doAfterContent(); } - /** overloaded by derived classes */ + /** overloaded by derived classes + * @return string + */ function doAfterContent() { return ''; } @@ -388,6 +391,7 @@ class LegacyTemplate extends BaseTemplate { /** * Show a drop-down box of special pages + * @return string */ function specialPagesList() { global $wgScript; @@ -530,6 +534,7 @@ class LegacyTemplate extends BaseTemplate { /** * @deprecated in 1.19 + * @return string */ function getQuickbarCompensator( $rows = 1 ) { wfDeprecated( __METHOD__, '1.19' ); diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index ab254d2c29..6e370fb95c 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -513,6 +513,7 @@ class SkinTemplate extends Skin { * This is setup as a method so that like with $wgLogo and getLogo() a skin * can override this setting and always output one or the other if it has * a reason it can't output one of the two modes. + * @return bool */ function useCombinedLoginLink() { global $wgUseCombinedLoginLink; @@ -1310,6 +1311,7 @@ abstract class QuickTemplate { /** * @private + * @return bool */ function haveData( $str ) { return isset( $this->data[$str] ); @@ -1369,6 +1371,7 @@ abstract class BaseTemplate extends QuickTemplate { * stored by SkinTemplate. * The resulting array is built acording to a format intended to be passed * through makeListItem to generate the html. + * @return array */ function getToolbox() { wfProfileIn( __METHOD__ ); @@ -1429,6 +1432,7 @@ abstract class BaseTemplate extends QuickTemplate { * This is in reality the same list as already stored in personal_urls * however it is reformatted so that you can just pass the individual items * to makeListItem instead of hardcoding the element creation boilerplate. + * @return array */ function getPersonalTools() { $personal_tools = array(); @@ -1602,6 +1606,7 @@ abstract class BaseTemplate extends QuickTemplate { * A link-fallback can be used to specify a tag to use instead of if there is * no link. eg: If you specify 'link-fallback' => 'span' than any non-link will * output a instead of just text. + * @return string */ function makeLink( $key, $item, $options = array() ) { if ( isset( $item['text'] ) ) { @@ -1680,6 +1685,7 @@ abstract class BaseTemplate extends QuickTemplate { * If you need an id or class on a single link you should include a "links" * array with just one link item inside of it. * $options is also passed on to makeLink calls + * @return string */ function makeListItem( $key, $item, $options = array() ) { if ( isset( $item['links'] ) ) { @@ -1774,6 +1780,7 @@ abstract class BaseTemplate extends QuickTemplate { * If you pass "flat" as an option then the returned array will be a flat array * of footer icons instead of a key/value array of footerlinks arrays broken * up into categories. + * @return array|mixed */ function getFooterLinks( $option = null ) { $footerlinks = $this->data['footerlinks']; @@ -1812,6 +1819,7 @@ abstract class BaseTemplate extends QuickTemplate { * in the list of footer icons. This is mostly useful for skins which only * display the text from footericons instead of the images and don't want a * duplicate copyright statement because footerlinks already rendered one. + * @return */ function getFooterIcons( $option = null ) { // Generate additional footer icons diff --git a/includes/SpecialPageFactory.php b/includes/SpecialPageFactory.php index 0a1631b0fe..66104514b8 100644 --- a/includes/SpecialPageFactory.php +++ b/includes/SpecialPageFactory.php @@ -276,6 +276,7 @@ class SpecialPageFactory { * Get the group that the special page belongs in on Special:SpecialPage * * @param $page SpecialPage + * @return String */ public static function getGroup( &$page ) { $name = $page->getName(); diff --git a/includes/Status.php b/includes/Status.php index e9f3fb91fa..7b583b1ee0 100644 --- a/includes/Status.php +++ b/includes/Status.php @@ -28,6 +28,7 @@ class Status { * Factory function for fatal errors * * @param $message String: message name + * @return Status */ static function newFatal( $message /*, parameters...*/ ) { $params = func_get_args(); @@ -41,6 +42,7 @@ class Status { * Factory function for good results * * @param $value Mixed + * @return Status */ static function newGood( $value = null ) { $result = new self; diff --git a/includes/StubObject.php b/includes/StubObject.php index 647ad929ac..795b5d65be 100644 --- a/includes/StubObject.php +++ b/includes/StubObject.php @@ -52,6 +52,7 @@ class StubObject { * * @param $name String: name of the function called * @param $args Array: arguments + * @return mixed */ function _call( $name, $args ) { $this->_unstub( $name, 5 ); @@ -72,6 +73,7 @@ class StubObject { * * @param $name String: name of the function called * @param $args Array: arguments + * @return mixed */ function __call( $name, $args ) { return $this->_call( $name, $args ); diff --git a/includes/Title.php b/includes/Title.php index 53be6b9a6b..fe96ecdfaa 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -863,6 +863,7 @@ class Title { * This is MUCH simpler than individually testing for equivilance * against both NS_USER and NS_USER_TALK, and is also forward compatible. * @since 1.19 + * @return bool */ public function hasSubjectNamespace( $ns ) { return MWNamespace::subjectEquals( $this->getNamespace(), $ns ); @@ -1226,6 +1227,7 @@ class Title { * andthe wfArrayToCGI moved to getLocalURL(); * * @since 1.19 (r105919) + * @return String */ private static function fixUrlQueryArgs( $query, $query2 = false ) { if( $query2 !== false ) { @@ -1478,6 +1480,7 @@ class Title { * * @see self::getLocalURL * @since 1.18 + * @return string */ public function escapeCanonicalURL( $query = '', $query2 = false ) { wfDeprecated( __METHOD__, '1.19' ); diff --git a/includes/UserMailer.php b/includes/UserMailer.php index fe01a8b137..9909ba4f18 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -300,6 +300,7 @@ class UserMailer { /** * Converts a string into quoted-printable format * @since 1.17 + * @return string */ public static function quotedPrintable( $string, $charset = '' ) { # Probably incomplete; see RFC 2045 @@ -705,6 +706,7 @@ class EmailNotification { /** * Same as sendPersonalised but does impersonal mail suitable for bulk * mailing. Takes an array of MailAddress objects. + * @return Status */ function sendImpersonal( $addresses ) { global $wgContLang; diff --git a/includes/UserRightsProxy.php b/includes/UserRightsProxy.php index dfce8adf77..c61ca84676 100644 --- a/includes/UserRightsProxy.php +++ b/includes/UserRightsProxy.php @@ -163,6 +163,7 @@ class UserRightsProxy { /** * Replaces User::getUserGroups() + * @return array */ function getGroups() { $res = $this->db->select( 'user_groups', diff --git a/includes/WikiFilePage.php b/includes/WikiFilePage.php index 8aeaa2435b..4e227f68c6 100644 --- a/includes/WikiFilePage.php +++ b/includes/WikiFilePage.php @@ -148,6 +148,7 @@ class WikiFilePage extends WikiPage { /** * Override handling of action=purge + * @return bool */ public function doPurge() { $this->loadFile(); diff --git a/includes/WikiPage.php b/includes/WikiPage.php index b66b01ae49..05401fa294 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -888,6 +888,7 @@ class WikiPage extends Page { /** * Perform the actions of a page purging + * @return bool */ public function doPurge() { global $wgUseSquid; @@ -1498,6 +1499,7 @@ class WikiPage extends Page { /** * Prepare text which is about to be saved. * Returns a stdclass with source, pst and output members + * @return bool|object */ public function prepareTextForEdit( $text, $revid = null, User $user = null ) { global $wgParser, $wgContLang, $wgUser; @@ -2169,6 +2171,7 @@ class WikiPage extends Page { * * @param $resultDetails Array: contains result-specific array of additional values * @param $guser User The user performing the rollback + * @return array */ public function commitRollback( $fromP, $summary, $bot, &$resultDetails, User $guser ) { global $wgUseRCPatrol, $wgContLang; @@ -2793,6 +2796,7 @@ class WikiPage extends Page { /** * @deprecated since 1.18 + * @return bool */ public function useParserCache( $oldid ) { wfDeprecated( __METHOD__, '1.18' ); @@ -2973,6 +2977,7 @@ class PoolWorkArticleView extends PoolCounterWork { /** * @param $status Status + * @return bool */ function error( $status ) { $this->error = $status; diff --git a/includes/Xml.php b/includes/Xml.php index 67e13fd490..663a852033 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -40,6 +40,7 @@ class Xml { * The values are passed to Sanitizer::encodeAttribute. * Return null if no attributes given. * @param $attribs Array of attributes for an XML element + * @return null|string */ public static function expandAttributes( $attribs ) { $out = ''; diff --git a/includes/ZipDirectoryReader.php b/includes/ZipDirectoryReader.php index a7a2b94e1d..b2ce789760 100644 --- a/includes/ZipDirectoryReader.php +++ b/includes/ZipDirectoryReader.php @@ -426,6 +426,7 @@ class ZipDirectoryReader { /** * Interpret ZIP64 "extra field" data and return an associative array. + * @return array|bool */ function unpackZip64Extra( $extraField ) { $extraHeaderInfo = array( @@ -520,6 +521,7 @@ class ZipDirectoryReader { * If there are not enough bytes in the file to satsify the request, the * return value will be truncated. If a request is made for a segment beyond * the end of the file, an empty string will be returned. + * @return string */ function getSegment( $segIndex ) { if ( !isset( $this->buffer[$segIndex] ) ) { @@ -542,6 +544,7 @@ class ZipDirectoryReader { /** * Get the size of a structure in bytes. See unpack() for the format of $struct. + * @return int */ function getStructSize( $struct ) { $size = 0; diff --git a/includes/revisiondelete/RevisionDelete.php b/includes/revisiondelete/RevisionDelete.php index 6cee62466b..072aef1968 100644 --- a/includes/revisiondelete/RevisionDelete.php +++ b/includes/revisiondelete/RevisionDelete.php @@ -191,6 +191,7 @@ class RevDel_RevisionItem extends RevDel_Item { /** * Get the HTML link to the revision text. * Overridden by RevDel_ArchiveItem. + * @return string */ protected function getRevisionLink() { $date = $this->list->getLanguage()->timeanddate( $this->revision->getTimestamp(), true ); @@ -211,6 +212,7 @@ class RevDel_RevisionItem extends RevDel_Item { /** * Get the HTML link to the diff. * Overridden by RevDel_ArchiveItem + * @return string */ protected function getDiffLink() { if ( $this->isDeleted() && !$this->canViewContent() ) { @@ -569,6 +571,7 @@ class RevDel_FileItem extends RevDel_Item { /** * Get the link to the file. * Overridden by RevDel_ArchivedFileItem. + * @return string */ protected function getLink() { $date = $this->list->getLanguage()->timeanddate( $this->file->getTimestamp(), true ); diff --git a/includes/revisiondelete/RevisionDeleteAbstracts.php b/includes/revisiondelete/RevisionDeleteAbstracts.php index c961439baf..36d5f647d7 100644 --- a/includes/revisiondelete/RevisionDeleteAbstracts.php +++ b/includes/revisiondelete/RevisionDeleteAbstracts.php @@ -16,6 +16,7 @@ abstract class RevDel_List extends RevisionListBase { * Get the DB field name associated with the ID list. * This used to populate the log_search table for finding log entries. * Override this function. + * @return null */ public static function getRelationType() { return null; @@ -189,6 +190,7 @@ abstract class RevDel_List extends RevisionListBase { /** * Get the log action for this list type + * @return string */ public function getLogAction() { return 'revision'; @@ -247,6 +249,7 @@ abstract class RevDel_Item extends RevisionItemBase { * Returns true if the item is "current", and the operation to set the given * bits can't be executed for that reason * STUB + * @return bool */ public function isHideCurrentOp( $newBits ) { return false; diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index 7ff292b6b5..0348ed1cbd 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -65,6 +65,7 @@ class SearchEngine { /** * If this search backend can list/unlist redirects * @deprecated since 1.18 Call supports( 'list-redirects' ); + * @return bool */ function acceptListRedirects() { wfDeprecated( __METHOD__, '1.18' ); @@ -147,6 +148,7 @@ class SearchEngine { /** * Really find the title match. + * @return null|\Title */ private static function getNearMatchInternal( $searchterm ) { global $wgContLang, $wgEnableSearchContributorsByIP; @@ -287,6 +289,7 @@ class SearchEngine { * or namespace names * * @param $query String + * @return string */ function replacePrefixes( $query ) { global $wgContLang; @@ -391,6 +394,7 @@ class SearchEngine { * and preferences * * @param $namespaces Array + * @return array */ public static function namespacesAsText( $namespaces ) { global $wgContLang; @@ -1185,6 +1189,7 @@ class SearchHighlighter { * Do manual case conversion for non-ascii chars * * @param $matches Array + * @return string */ function caseCallback( $matches ) { global $wgContLang; @@ -1305,6 +1310,7 @@ class SearchHighlighter { /** * Basic wikitext removal * @protected + * @return mixed */ function removeWiki( $text ) { $fname = __METHOD__; diff --git a/includes/search/SearchIBM_DB2.php b/includes/search/SearchIBM_DB2.php index c02a009dec..51ed000f62 100644 --- a/includes/search/SearchIBM_DB2.php +++ b/includes/search/SearchIBM_DB2.php @@ -111,6 +111,7 @@ class SearchIBM_DB2 extends SearchEngine { * The guts shoulds be constructed in queryMain() * @param $filteredTerm String * @param $fulltext Boolean + * @return String */ function getQuery( $filteredTerm, $fulltext ) { return $this->queryLimit($this->queryMain($filteredTerm, $fulltext) . ' ' . @@ -145,7 +146,9 @@ class SearchIBM_DB2 extends SearchEngine { 'WHERE page_id=si_page AND ' . $match; } - /** @todo document */ + /** @todo document + * @return string + */ function parseQuery($filteredText, $fulltext) { global $wgContLang; $lc = SearchEngine::legalSearchChars(); diff --git a/includes/search/SearchMssql.php b/includes/search/SearchMssql.php index ebf19d3a8f..69c92ba324 100644 --- a/includes/search/SearchMssql.php +++ b/includes/search/SearchMssql.php @@ -115,6 +115,7 @@ class SearchMssql extends SearchEngine { * * @param $filteredTerm String * @param $fulltext Boolean + * @return String */ function getQuery( $filteredTerm, $fulltext ) { return $this->queryLimit( $this->queryMain( $filteredTerm, $fulltext ) . ' ' . @@ -151,7 +152,9 @@ class SearchMssql extends SearchEngine { 'WHERE page_id=ftindex.[KEY] '; } - /** @todo document */ + /** @todo document + * @return string + */ function parseQuery( $filteredText, $fulltext ) { global $wgContLang; $lc = SearchEngine::legalSearchChars(); @@ -189,6 +192,7 @@ class SearchMssql extends SearchEngine { * @param $id Integer * @param $title String * @param $text String + * @return bool|\ResultWrapper */ function update( $id, $title, $text ) { // We store the column data as UTF-8 byte order marked binary stream @@ -211,6 +215,7 @@ class SearchMssql extends SearchEngine { * * @param $id Integer * @param $title String + * @return bool|\ResultWrapper */ function updateTitle( $id, $title ) { $table = $this->db->tableName( 'searchindex' ); diff --git a/includes/search/SearchMySQL.php b/includes/search/SearchMySQL.php index a74d215018..5cee03e0fd 100644 --- a/includes/search/SearchMySQL.php +++ b/includes/search/SearchMySQL.php @@ -308,6 +308,7 @@ class SearchMySQL extends SearchEngine { /** * @since 1.18 (changed) + * @return array */ function getCountQuery( $filteredTerm, $fulltext ) { $match = $this->parseQuery( $filteredTerm, $fulltext ); @@ -365,6 +366,7 @@ class SearchMySQL extends SearchEngine { /** * Converts some characters for MySQL's indexing to grok it correctly, * and pads short words to overcome limitations. + * @return mixed|string */ function normalizeText( $string ) { global $wgContLang; @@ -412,6 +414,7 @@ class SearchMySQL extends SearchEngine { * Armor a case-folded UTF-8 string to get through MySQL's * fulltext search without being mucked up by funny charset * settings or anything else of the sort. + * @return string */ protected function stripForSearchCallback( $matches ) { return 'u8' . bin2hex( $matches[1] ); diff --git a/includes/search/SearchOracle.php b/includes/search/SearchOracle.php index 2d6fc3e2cc..1c45dc46af 100644 --- a/includes/search/SearchOracle.php +++ b/includes/search/SearchOracle.php @@ -147,6 +147,7 @@ class SearchOracle extends SearchEngine { * The guts shoulds be constructed in queryMain() * @param $filteredTerm String * @param $fulltext Boolean + * @return String */ function getQuery( $filteredTerm, $fulltext ) { return $this->queryLimit($this->queryMain($filteredTerm, $fulltext) . ' ' . @@ -184,6 +185,7 @@ class SearchOracle extends SearchEngine { /** * Parse a user input search string, and return an SQL fragment to be used * as part of a WHERE clause + * @return string */ function parseQuery($filteredText, $fulltext) { global $wgContLang; diff --git a/includes/search/SearchPostgres.php b/includes/search/SearchPostgres.php index cfe283b28d..68648894bc 100644 --- a/includes/search/SearchPostgres.php +++ b/includes/search/SearchPostgres.php @@ -146,6 +146,7 @@ class SearchPostgres extends SearchEngine { * @param $term String * @param $fulltext String * @param $colname + * @return string */ function searchQuery( $term, $fulltext, $colname ) { # Get the SQL fragment for the given term diff --git a/includes/search/SearchSqlite.php b/includes/search/SearchSqlite.php index cd59eea985..e52e4fe391 100644 --- a/includes/search/SearchSqlite.php +++ b/includes/search/SearchSqlite.php @@ -238,6 +238,7 @@ class SearchSqlite extends SearchEngine { * The guts shoulds be constructed in queryMain() * @param $filteredTerm String * @param $fulltext Boolean + * @return String */ function getQuery( $filteredTerm, $fulltext ) { return $this->limitResult( diff --git a/includes/specials/SpecialAllmessages.php b/includes/specials/SpecialAllmessages.php index 2bfea4c3fa..b9f92f8394 100644 --- a/includes/specials/SpecialAllmessages.php +++ b/includes/specials/SpecialAllmessages.php @@ -290,6 +290,7 @@ class AllmessagesTablePager extends TablePager { /** * This function normally does a database query to get the results; we need * to make a pretend result using a FakeResultWrapper. + * @return \FakeResultWrapper */ function reallyDoQuery( $offset, $limit, $descending ) { $result = new FakeResultWrapper( array() ); diff --git a/includes/specials/SpecialAllpages.php b/includes/specials/SpecialAllpages.php index 960a327a05..619f23ddef 100644 --- a/includes/specials/SpecialAllpages.php +++ b/includes/specials/SpecialAllpages.php @@ -95,6 +95,7 @@ class SpecialAllpages extends IncludableSpecialPage { * @param $namespace Integer: a namespace constant (default NS_MAIN). * @param $from String: dbKey we are starting listing at. * @param $to String: dbKey we are ending listing at. + * @return string */ function namespaceForm( $namespace = NS_MAIN, $from = '', $to = '' ) { global $wgScript; @@ -270,6 +271,7 @@ class SpecialAllpages extends IncludableSpecialPage { * @param $inpoint String: lower limit of pagenames * @param $outpoint String: upper limit of pagenames * @param $namespace Integer (Default NS_MAIN) + * @return string */ function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) { global $wgContLang; diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index 7d93cc75d2..5b5b356fd3 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -297,6 +297,7 @@ class SpecialBlock extends FormSpecialPage { /** * Add header elements like block log entries, etc. + * @return String */ protected function preText(){ $text = $this->msg( 'blockiptext' )->parse(); diff --git a/includes/specials/SpecialBooksources.php b/includes/specials/SpecialBooksources.php index 68f6fa1b52..bc07d586d4 100644 --- a/includes/specials/SpecialBooksources.php +++ b/includes/specials/SpecialBooksources.php @@ -64,6 +64,7 @@ class SpecialBookSources extends SpecialPage { /** * Returns whether a given ISBN (10 or 13) is valid. True indicates validity. * @param isbn string ISBN passed for check + * @return bool */ public static function isValidISBN( $isbn ) { $isbn = self::cleanIsbn( $isbn ); diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 865295bfff..f538abb68a 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -698,6 +698,7 @@ class ContribsPager extends ReverseChronologicalPager { /** * Do a batched query to get the parent revision lengths + * @return array */ private function getParentLengths( array $revIds ) { $revLens = array(); @@ -739,6 +740,7 @@ class ContribsPager extends ReverseChronologicalPager { * was not written by the target user. * * @todo This would probably look a lot nicer in a table. + * @return string */ function formatRow( $row ) { wfProfileIn( __METHOD__ ); @@ -871,6 +873,7 @@ class ContribsPager extends ReverseChronologicalPager { /** * Overwrite Pager function and return a helpful comment + * @return string */ function getSqlComment() { if ( $this->namespace || $this->deletedOnly ) { diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index 47e2e218be..3ce0536248 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -130,6 +130,7 @@ class DeletedContribsPager extends IndexPager { * written by the target user. * * @todo This would probably look a lot nicer in a table. + * @return string */ function formatRow( $row ) { wfProfileIn( __METHOD__ ); @@ -449,6 +450,7 @@ class DeletedContributionsPage extends SpecialPage { /** * Generates the namespace selector form with hidden attributes. * @param $options Array: the options to be included. + * @return string */ function getForm( $options ) { global $wgScript; diff --git a/includes/specials/SpecialExport.php b/includes/specials/SpecialExport.php index d061389ea3..706a651867 100644 --- a/includes/specials/SpecialExport.php +++ b/includes/specials/SpecialExport.php @@ -510,6 +510,7 @@ class SpecialExport extends SpecialPage { /** * Expand a list of pages to include items used in those pages. + * @return array */ private function getLinks( $inputPages, $pageSet, $table, $fields, $join ) { $dbr = wfGetDB( DB_SLAVE ); diff --git a/includes/specials/SpecialFewestrevisions.php b/includes/specials/SpecialFewestrevisions.php index 27d17f632c..60811ac468 100644 --- a/includes/specials/SpecialFewestrevisions.php +++ b/includes/specials/SpecialFewestrevisions.php @@ -68,6 +68,7 @@ class FewestrevisionsPage extends QueryPage { /** * @param $skin Skin object * @param $result Object: database row + * @return String */ function formatResult( $skin, $result ) { global $wgContLang; diff --git a/includes/specials/SpecialJavaScriptTest.php b/includes/specials/SpecialJavaScriptTest.php index a7d8c3cd55..87221186f1 100644 --- a/includes/specials/SpecialJavaScriptTest.php +++ b/includes/specials/SpecialJavaScriptTest.php @@ -97,6 +97,7 @@ class SpecialJavaScriptTest extends SpecialPage { * be thrown. * @param $html String: The raw HTML. * @param $state String: State, one of 'noframework', 'unknownframework' or 'frameworkfound' + * @return string */ private function wrapSummaryHtml( $html, $state ) { $validStates = array( 'noframework', 'unknownframework', 'frameworkfound' ); diff --git a/includes/specials/SpecialLinkSearch.php b/includes/specials/SpecialLinkSearch.php index d3ab2f0494..7192de6ec2 100644 --- a/includes/specials/SpecialLinkSearch.php +++ b/includes/specials/SpecialLinkSearch.php @@ -112,6 +112,7 @@ class LinkSearchPage extends QueryPage { /** * Disable RSS/Atom feeds + * @return bool */ function isSyndicated() { return false; @@ -203,6 +204,7 @@ class LinkSearchPage extends QueryPage { * We do a truncated index search, so the optimizer won't trust * it as good enough for optimizing sort. The implicit ordering * from the scan will usually do well enough for our needs. + * @return array */ function getOrderFields() { return array(); diff --git a/includes/specials/SpecialPrefixindex.php b/includes/specials/SpecialPrefixindex.php index 495f15f77e..40a38e84e9 100644 --- a/includes/specials/SpecialPrefixindex.php +++ b/includes/specials/SpecialPrefixindex.php @@ -83,7 +83,8 @@ class SpecialPrefixindex extends SpecialAllpages { * HTML for the top form * @param $namespace Integer: a namespace constant (default NS_MAIN). * @param $from String: dbKey we are starting listing at. - */ + * @return string + */ function namespacePrefixForm( $namespace = NS_MAIN, $from = '' ) { global $wgScript; diff --git a/includes/specials/SpecialProtectedtitles.php b/includes/specials/SpecialProtectedtitles.php index 982feb661b..f4232cc9e1 100644 --- a/includes/specials/SpecialProtectedtitles.php +++ b/includes/specials/SpecialProtectedtitles.php @@ -112,6 +112,7 @@ class SpecialProtectedtitles extends SpecialPage { * @param $namespace Integer: * @param $type string * @param $level string + * @return string * @private */ function showOptions( $namespace, $type='edit', $level ) { diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index c58aba1ade..f8828ea3ff 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -534,6 +534,7 @@ class SpecialRecentChanges extends IncludableSpecialPage { /** * Get the query string to append to feed link URLs. * This is overridden by RCL to add the target parameter + * @return bool */ public function getFeedQuery() { return false; @@ -760,6 +761,7 @@ class SpecialRecentChanges extends IncludableSpecialPage { * @param $override Array: options to override * @param $options Array: current options * @param $active Boolean: whether to show the link in bold + * @return string */ function makeOptionsLink( $title, $override, $options, $active = false ) { $params = $override + $options; @@ -775,6 +777,7 @@ class SpecialRecentChanges extends IncludableSpecialPage { * * @param $defaults Array * @param $nondefaults Array + * @return string */ function optionsPanel( $defaults, $nondefaults ) { global $wgRCLinkLimits, $wgRCLinkDays; diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index df60a26ad2..0388f5b912 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -251,6 +251,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { /** * Get the condition used for fetching log snippets + * @return array */ protected function getLogQueryCond() { $conds = array(); @@ -497,6 +498,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { /** * UI entry point for form submission. + * @return bool */ protected function submit() { # Check edit token on submission @@ -592,6 +594,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { /** * Do the write operations. Simple wrapper for RevDel_*List::setVisibility(). + * @return */ protected function save( $bitfield, $reason, $title ) { return $this->getList()->setVisibility( diff --git a/includes/specials/SpecialUnblock.php b/includes/specials/SpecialUnblock.php index 479443097a..52218ce335 100644 --- a/includes/specials/SpecialUnblock.php +++ b/includes/specials/SpecialUnblock.php @@ -136,6 +136,7 @@ class SpecialUnblock extends SpecialPage { /** * Submit callback for an HTMLForm object + * @return \Array( Array(message key, parameters) */ public static function processUIUnblock( array $data, HTMLForm $form ) { return self::processUnblock( $data, $form->getContext() ); diff --git a/includes/specials/SpecialUnusedcategories.php b/includes/specials/SpecialUnusedcategories.php index 48a93e8d3c..611a33c3bf 100644 --- a/includes/specials/SpecialUnusedcategories.php +++ b/includes/specials/SpecialUnusedcategories.php @@ -52,6 +52,7 @@ class UnusedCategoriesPage extends QueryPage { /** * A should come before Z (bug 30907) + * @return bool */ function sortDescending() { return false; diff --git a/includes/specials/SpecialUploadStash.php b/includes/specials/SpecialUploadStash.php index 121b6a44a5..cb44d8533b 100644 --- a/includes/specials/SpecialUploadStash.php +++ b/includes/specials/SpecialUploadStash.php @@ -58,6 +58,7 @@ class SpecialUploadStash extends UnlistedSpecialPage { * n.b. Most sanity checking done in UploadStashLocalFile, so this is straightforward. * * @param $key String: the key of a particular requested file + * @return bool */ public function showUpload( $key ) { // prevent callers from doing standard HTML output -- we'll take it from here @@ -241,6 +242,7 @@ class SpecialUploadStash extends UnlistedSpecialPage { * Side effect: writes HTTP response to STDOUT. * * @param $file File object with a local path (e.g. UnregisteredLocalFile, LocalFile. Oddly these don't share an ancestor!) + * @return bool */ private function outputLocalFile( File $file ) { if ( $file->getSize() > self::MAX_SERVE_BYTES ) { @@ -257,6 +259,7 @@ class SpecialUploadStash extends UnlistedSpecialPage { * Side effect: writes HTTP response to STDOUT. * @param String $content: content * @param String $mimeType: mime type + * @return bool */ private function outputContents( $content, $contentType ) { $size = strlen( $content ); @@ -304,6 +307,7 @@ class SpecialUploadStash extends UnlistedSpecialPage { * Default action when we don't have a subpage -- just show links to the uploads we have, * Also show a button to clear stashed files * @param Status : $status - the result of processRequest + * @return bool */ private function showUploads( $status = null ) { if ( $status === null ) { diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index c5843c4939..cb3e8792d4 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -209,6 +209,7 @@ class LoginForm extends SpecialPage { /** * @private + * @return bool|void */ function addNewAccount() { global $wgUser, $wgEmailAuthentication, $wgLoginLanguageSelector; @@ -270,6 +271,7 @@ class LoginForm extends SpecialPage { /** * @private + * @return bool|\User */ function addNewAccountInternal() { global $wgAuth, $wgMemc, $wgAccountCreationThrottle, @@ -470,6 +472,7 @@ class LoginForm extends SpecialPage { * This may create a local account as a side effect if the * authentication plugin allows transparent local account * creation. + * @return int */ public function authenticateUserData() { global $wgUser, $wgAuth; @@ -1117,6 +1120,7 @@ class LoginForm extends SpecialPage { * previous pass through the system. * * @private + * @return bool */ function hasSessionCookie() { global $wgDisableCookieCheck; @@ -1125,6 +1129,7 @@ class LoginForm extends SpecialPage { /** * Get the login token from the current session + * @return Mixed */ public static function getLoginToken() { global $wgRequest; @@ -1151,6 +1156,7 @@ class LoginForm extends SpecialPage { /** * Get the createaccount token from the current session + * @return Mixed */ public static function getCreateaccountToken() { global $wgRequest; @@ -1175,6 +1181,7 @@ class LoginForm extends SpecialPage { /** * @private + * @return void */ function cookieRedirectCheck( $type ) { $titleObj = SpecialPage::getTitleFor( 'Userlogin' ); @@ -1243,6 +1250,7 @@ class LoginForm extends SpecialPage { * * @param $text Link text * @param $lang Language code + * @return string */ function makeLanguageSelectorLink( $text, $lang ) { $attr = array( 'uselang' => $lang ); diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 8185fe8863..3c6659ead8 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -356,6 +356,7 @@ class SpecialVersion extends SpecialPage { /** * Callback to sort extensions by type. + * @return int */ function compare( $a, $b ) { if( $a['name'] === $b['name'] ) { @@ -589,6 +590,7 @@ class SpecialVersion extends SpecialPage { * url The subversion URL of the directory * repo-url The base URL of the repository * viewvc-url A ViewVC URL pointing to the checked-out revision + * @return array|bool */ public static function getSvnInfo( $dir ) { // http://svnbook.red-bean.com/nightly/en/svn.developer.insidewc.html diff --git a/includes/specials/SpecialWantedfiles.php b/includes/specials/SpecialWantedfiles.php index ec0912df62..25b93b15a4 100644 --- a/includes/specials/SpecialWantedfiles.php +++ b/includes/specials/SpecialWantedfiles.php @@ -66,6 +66,7 @@ class WantedFilesPage extends WantedQueryPage { * that exist e.g. in a shared repo. Setting this at least * keeps them from showing up as redlinks in the output, even * if it doesn't fix the real problem (bug 6220). + * @return bool */ function forceExistenceCheck() { return true; diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index b89c9dccb7..81143d28ef 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -64,6 +64,7 @@ abstract class UploadBase { /** * Returns true if uploads are enabled. * Can be override by subclasses. + * @return bool */ public static function isEnabled() { global $wgEnableUploads; @@ -82,6 +83,7 @@ abstract class UploadBase { * Can be overriden by subclasses. * * @param $user User + * @return bool */ public static function isAllowed( $user ) { foreach ( array( 'upload', 'edit' ) as $permission ) { @@ -100,6 +102,7 @@ abstract class UploadBase { * * @param $request WebRequest * @param $type + * @return null */ public static function createFromRequest( &$request, $type = null ) { $type = $type ? $type : $request->getVal( 'wpSourceType', 'File' ); @@ -140,6 +143,7 @@ abstract class UploadBase { /** * Check whether a request if valid for this handler + * @return bool */ public static function isValidRequest( $request ) { return false; @@ -180,6 +184,7 @@ abstract class UploadBase { /** * Fetch the file. Usually a no-op + * @return Status */ public function fetchFile() { return Status::newGood(); @@ -984,6 +989,7 @@ abstract class UploadBase { /** * @todo Replace this with a whitelist filter! + * @return bool */ public function checkSvgScriptCallback( $element, $attribs ) { $stripped = $this->stripXmlNamespace( $element ); @@ -1249,6 +1255,7 @@ abstract class UploadBase { /** * Helper function that checks whether the filename looks like a thumbnail + * @return bool */ public static function isThumbName( $filename ) { $n = strrpos( $filename, '.' ); diff --git a/includes/upload/UploadFromChunks.php b/includes/upload/UploadFromChunks.php index 24c07a8b5a..b77c56035b 100644 --- a/includes/upload/UploadFromChunks.php +++ b/includes/upload/UploadFromChunks.php @@ -129,6 +129,7 @@ class UploadFromChunks extends UploadFromFile { /** * Returns the virtual chunk location: * @param $index + * @return string */ function getVirtualChunkLocation( $index ){ return $this->repo->getVirtualUrl( 'temp' ) . @@ -241,6 +242,7 @@ class UploadFromChunks extends UploadFromFile { * Output the chunk to disk * * @param $chunkPath string + * @return \FileRepoStatus */ private function outputChunk( $chunkPath ){ // Key is fileKey + chunk index diff --git a/includes/upload/UploadFromFile.php b/includes/upload/UploadFromFile.php index 23ec2ef414..234fde848b 100644 --- a/includes/upload/UploadFromFile.php +++ b/includes/upload/UploadFromFile.php @@ -14,6 +14,7 @@ class UploadFromFile extends UploadBase { /** * @param $request WebRequest + * @return null */ function initializeFromRequest( &$request ) { $upload = $request->getUpload( 'wpUploadFile' ); @@ -28,6 +29,7 @@ class UploadFromFile extends UploadBase { * Initialize from a filename and a WebRequestUpload * @param $name * @param $webRequestUpload + * @return null */ function initialize( $name, $webRequestUpload ) { $this->mUpload = $webRequestUpload; diff --git a/includes/upload/UploadFromUrl.php b/includes/upload/UploadFromUrl.php index da772fe2c1..252cbc86aa 100644 --- a/includes/upload/UploadFromUrl.php +++ b/includes/upload/UploadFromUrl.php @@ -180,6 +180,7 @@ class UploadFromUrl extends UploadBase { /** * Wrapper around the parent function in order to defer verifying the * upload until the file really has been fetched. + * @return array|mixed */ public function verifyUpload() { if ( $this->mAsync ) { @@ -191,6 +192,7 @@ class UploadFromUrl extends UploadBase { /** * Wrapper around the parent function in order to defer checking warnings * until the file really has been fetched. + * @return Array */ public function checkWarnings() { if ( $this->mAsync ) { @@ -203,6 +205,7 @@ class UploadFromUrl extends UploadBase { /** * Wrapper around the parent function in order to defer checking protection * until we are sure that the file can actually be uploaded + * @return bool|mixed */ public function verifyTitlePermissions( $user ) { if ( $this->mAsync ) { @@ -214,6 +217,7 @@ class UploadFromUrl extends UploadBase { /** * Wrapper around the parent function in order to defer uploading to the * job queue for asynchronous uploads + * @return Status */ public function performUpload( $comment, $pageText, $watch, $user ) { if ( $this->mAsync ) { diff --git a/includes/upload/UploadStash.php b/includes/upload/UploadStash.php index ad153d2fc3..009c9b641a 100644 --- a/includes/upload/UploadStash.php +++ b/includes/upload/UploadStash.php @@ -391,6 +391,7 @@ class UploadStash { * with an extension. * XXX this is somewhat redundant with the checks that ApiUpload.php does with incoming * uploads versus the desired filename. Maybe we can get that passed to us... + * @return string */ public static function getExtensionForPath( $path ) { // Does this have an extension? -- 2.20.1