More return documentation
authorSam Reed <reedy@users.mediawiki.org>
Thu, 9 Feb 2012 21:36:14 +0000 (21:36 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 9 Feb 2012 21:36:14 +0000 (21:36 +0000)
50 files changed:
includes/QueryPage.php
includes/Revision.php
includes/RevisionList.php
includes/Skin.php
includes/SkinLegacy.php
includes/SkinTemplate.php
includes/SpecialPageFactory.php
includes/Status.php
includes/StubObject.php
includes/Title.php
includes/UserMailer.php
includes/UserRightsProxy.php
includes/WikiFilePage.php
includes/WikiPage.php
includes/Xml.php
includes/ZipDirectoryReader.php
includes/revisiondelete/RevisionDelete.php
includes/revisiondelete/RevisionDeleteAbstracts.php
includes/search/SearchEngine.php
includes/search/SearchIBM_DB2.php
includes/search/SearchMssql.php
includes/search/SearchMySQL.php
includes/search/SearchOracle.php
includes/search/SearchPostgres.php
includes/search/SearchSqlite.php
includes/specials/SpecialAllmessages.php
includes/specials/SpecialAllpages.php
includes/specials/SpecialBlock.php
includes/specials/SpecialBooksources.php
includes/specials/SpecialContributions.php
includes/specials/SpecialDeletedContributions.php
includes/specials/SpecialExport.php
includes/specials/SpecialFewestrevisions.php
includes/specials/SpecialJavaScriptTest.php
includes/specials/SpecialLinkSearch.php
includes/specials/SpecialPrefixindex.php
includes/specials/SpecialProtectedtitles.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialRevisiondelete.php
includes/specials/SpecialUnblock.php
includes/specials/SpecialUnusedcategories.php
includes/specials/SpecialUploadStash.php
includes/specials/SpecialUserlogin.php
includes/specials/SpecialVersion.php
includes/specials/SpecialWantedfiles.php
includes/upload/UploadBase.php
includes/upload/UploadFromChunks.php
includes/upload/UploadFromFile.php
includes/upload/UploadFromUrl.php
includes/upload/UploadStash.php

index 3383551..4cad43e 100644 (file)
@@ -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;
index 445211c..f8e6890 100644 (file)
@@ -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' );
index 814e2df..ccd2570 100644 (file)
@@ -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() ) {
index 908a4c9..8cf1e78 100644 (file)
@@ -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 );
index 77c85a8..03ae3a4 100644 (file)
@@ -84,6 +84,7 @@ class LegacyTemplate extends BaseTemplate {
        /**
         * This will be called immediately after the <body> 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 '</div></div>';
        }
@@ -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' );
index ab254d2..6e370fb 100644 (file)
@@ -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 <a> if there is
         *   no link. eg: If you specify 'link-fallback' => 'span' than any non-link will
         *   output a <span> 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
index 0a1631b..6610451 100644 (file)
@@ -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();
index e9f3fb9..7b583b1 100644 (file)
@@ -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;
index 647ad92..795b5d6 100644 (file)
@@ -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 );
index 53be6b9..fe96ecd 100644 (file)
@@ -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' );
index fe01a8b..9909ba4 100644 (file)
@@ -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;
index dfce8ad..c61ca84 100644 (file)
@@ -163,6 +163,7 @@ class UserRightsProxy {
 
        /**
         * Replaces User::getUserGroups()
+        * @return array
         */
        function getGroups() {
                $res = $this->db->select( 'user_groups',
index 8aeaa24..4e227f6 100644 (file)
@@ -148,6 +148,7 @@ class WikiFilePage extends WikiPage {
 
        /**
         * Override handling of action=purge
+        * @return bool
         */
        public function doPurge() {
                $this->loadFile();
index b66b01a..05401fa 100644 (file)
@@ -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;
index 67e13fd..663a852 100644 (file)
@@ -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 = '';
index a7a2b94..b2ce789 100644 (file)
@@ -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;
index 6cee624..072aef1 100644 (file)
@@ -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  );
index c961439..36d5f64 100644 (file)
@@ -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;
index 7ff292b..0348ed1 100644 (file)
@@ -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__;
index c02a009..51ed000 100644 (file)
@@ -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();
index ebf19d3..69c92ba 100644 (file)
@@ -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' );
index a74d215..5cee03e 100644 (file)
@@ -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] );
index 2d6fc3e..1c45dc4 100644 (file)
@@ -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;
index cfe283b..6864889 100644 (file)
@@ -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
index cd59eea..e52e4fe 100644 (file)
@@ -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(
index 2bfea4c..b9f92f8 100644 (file)
@@ -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() );
index 960a327..619f23d 100644 (file)
@@ -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;
index 7d93cc7..5b5b356 100644 (file)
@@ -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();
index 68f6fa1..bc07d58 100644 (file)
@@ -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 );
index 865295b..f538abb 100644 (file)
@@ -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 ) {
index 47e2e21..3ce0536 100644 (file)
@@ -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;
index d061389..706a651 100644 (file)
@@ -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 );
index 27d17f6..60811ac 100644 (file)
@@ -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;
index a7d8c3c..8722118 100644 (file)
@@ -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' );
index d3ab2f0..7192de6 100644 (file)
@@ -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();
index 495f15f..40a38e8 100644 (file)
@@ -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;
 
index 982feb6..f4232cc 100644 (file)
@@ -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 ) {
index c58aba1..f8828ea 100644 (file)
@@ -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;
index df60a26..0388f5b 100644 (file)
@@ -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(
index 4794430..52218ce 100644 (file)
@@ -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() );
index 48a93e8..611a33c 100644 (file)
@@ -52,6 +52,7 @@ class UnusedCategoriesPage extends QueryPage {
 
        /**
         * A should come before Z (bug 30907)
+        * @return bool
         */
        function sortDescending() {
                return false;
index 121b6a4..cb44d85 100644 (file)
@@ -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 ) {
index c5843c4..cb3e879 100644 (file)
@@ -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 );
index 8185fe8..3c6659e 100644 (file)
@@ -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
index ec0912d..25b93b1 100644 (file)
@@ -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;
index b89c9dc..81143d2 100644 (file)
@@ -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, '.' );
index 24c07a8..b77c560 100644 (file)
@@ -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
index 23ec2ef..234fde8 100644 (file)
@@ -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;
index da772fe..252cbc8 100644 (file)
@@ -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 ) {
index ad153d2..009c9b6 100644 (file)
@@ -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?