Improve some parameter docs
authorUmherirrender <umherirrender_de.wp@web.de>
Sat, 9 Sep 2017 20:47:04 +0000 (22:47 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Sun, 10 Sep 2017 18:32:31 +0000 (20:32 +0200)
Add missing @return and @param to function docs and fixed some @param

Change-Id: I810727961057cfdcc274428b239af5975c57468d

107 files changed:
includes/AjaxDispatcher.php
includes/Block.php
includes/FormOptions.php
includes/OrderedStreamingForkController.php
includes/Pingback.php
includes/Title.php
includes/actions/InfoAction.php
includes/actions/MarkpatrolledAction.php
includes/api/ApiCSPReport.php
includes/api/ApiFormatBase.php
includes/api/ApiFormatFeedWrapper.php
includes/api/ApiMain.php
includes/api/ApiQueryBase.php
includes/api/ApiQueryGeneratorBase.php
includes/api/ApiUsageException.php
includes/changes/ChangesListFilter.php
includes/collation/IcuCollation.php
includes/compat/normal/UtfNormalUtil.php
includes/config/GlobalVarConfig.php
includes/config/HashConfig.php
includes/config/MultiConfig.php
includes/content/AbstractContent.php
includes/debug/logger/monolog/AvroFormatter.php
includes/deferred/WANCacheReapUpdate.php
includes/externalstore/ExternalStoreHttp.php
includes/externalstore/ExternalStoreMwstore.php
includes/filerepo/FileBackendDBRepoWrapper.php
includes/filerepo/ForeignAPIRepo.php
includes/filerepo/file/OldLocalFile.php
includes/htmlform/HTMLFormField.php
includes/http/Http.php
includes/http/PhpHttpRequest.php
includes/installer/InstallerSessionProvider.php
includes/installer/MssqlUpdater.php
includes/installer/MysqlInstaller.php
includes/installer/WebInstaller.php
includes/jobqueue/JobQueueSecondTestQueue.php
includes/jobqueue/aggregator/JobQueueAggregator.php
includes/libs/IP.php
includes/libs/MemoizedCallable.php
includes/libs/Xhprof.php
includes/libs/XhprofData.php
includes/libs/mime/IEContentAnalyzer.php
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/database/DatabaseMssql.php
includes/libs/rdbms/database/DatabasePostgres.php
includes/libs/stats/NullStatsdDataFactory.php
includes/libs/virtualrest/ParsoidVirtualRESTService.php
includes/libs/virtualrest/RestbaseVirtualRESTService.php
includes/libs/xmp/XMP.php
includes/media/WebP.php
includes/page/WikiPage.php
includes/parser/ParserOutput.php
includes/parser/Preprocessor.php
includes/parser/Preprocessor_Hash.php
includes/rcfeed/IRCColourfulRCFeedFormatter.php
includes/rcfeed/MachineReadableRCFeedFormatter.php
includes/rcfeed/RedisPubSubFeedEngine.php
includes/rcfeed/UDPRCFeedEngine.php
includes/resourceloader/ResourceLoaderImageModule.php
includes/resourceloader/ResourceLoaderSiteModule.php
includes/resourceloader/ResourceLoaderStartUpModule.php
includes/resourceloader/ResourceLoaderUploadDialogModule.php
includes/resourceloader/ResourceLoaderUserModule.php
includes/search/ParserOutputSearchDataExtractor.php
includes/search/SearchEngine.php
includes/search/SearchResultSet.php
includes/search/SearchSuggestionSet.php
includes/session/BotPasswordSessionProvider.php
includes/session/Session.php
includes/site/HashSiteStore.php
includes/skins/SkinTemplate.php
includes/specialpage/ChangesListSpecialPage.php
includes/specialpage/RedirectSpecialPage.php
includes/specialpage/WantedQueryPage.php
includes/specials/SpecialAllPages.php
includes/specials/SpecialBlock.php
includes/specials/SpecialLinkSearch.php
includes/specials/SpecialNewpages.php
includes/specials/SpecialUnlinkAccounts.php
includes/specials/SpecialUpload.php
includes/specials/SpecialWantedfiles.php
includes/tidy/Balancer.php
includes/tidy/TidyDriverBase.php
includes/utils/AutoloadGenerator.php
languages/LanguageConverter.php
maintenance/Maintenance.php
maintenance/addSite.php
maintenance/findDeprecated.php
maintenance/generateSitemap.php
maintenance/migrateComments.php
maintenance/userOptions.inc
tests/integration/includes/http/MWHttpRequestTestCase.php
tests/parser/DbTestPreviewer.php
tests/parser/ParserTestPrinter.php
tests/parser/ParserTestResultNormalizer.php
tests/parser/ParserTestRunner.php
tests/parser/PhpunitTestRecorder.php
tests/parser/TidySupport.php
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/ResourceLoaderTestCase.php
tests/phpunit/includes/db/DatabaseTestHelper.php
tests/phpunit/includes/specials/SpecialPageExecutor.php
tests/phpunit/includes/specials/SpecialPageTestBase.php
tests/phpunit/mocks/content/DummyContentHandlerForTesting.php
tests/phpunit/mocks/content/DummyNonTextContentHandler.php
tests/phpunit/mocks/filebackend/MockFSFile.php

index 2adbc80..75fcff3 100644 (file)
@@ -56,6 +56,7 @@ class AjaxDispatcher {
 
        /**
         * Load up our object with user supplied data
+        * @param Config $config
         */
        function __construct( Config $config ) {
                $this->config = $config;
index 40095f1..5a4c43e 100644 (file)
@@ -1329,7 +1329,7 @@ class Block {
         * which in turn gives User::getName().
         *
         * @param string|int|User|null $target
-        * @return array( User|String|null, Block::TYPE_ constant|null )
+        * @return array [ User|String|null, Block::TYPE_ constant|null ]
         */
        public static function parseTarget( $target ) {
                # We may have been through this before
@@ -1396,7 +1396,7 @@ class Block {
         * Get the target and target type for this particular Block.  Note that for autoblocks,
         * this returns the unredacted name; frontend functions need to call $block->getRedactedName()
         * in this situation.
-        * @return array( User|String, Block::TYPE_ constant )
+        * @return array [ User|String, Block::TYPE_ constant ]
         * @todo FIXME: This should be an integral part of the Block member variables
         */
        public function getTargetAndType() {
index 725a512..53c8d3b 100644 (file)
@@ -246,6 +246,9 @@ class FormOptions implements ArrayAccess {
 
        /**
         * @see validateBounds()
+        * @param string $name
+        * @param int $min
+        * @param int $max
         */
        public function validateIntBounds( $name, $min, $max ) {
                $this->validateBounds( $name, $min, $max );
index 1436c1c..ff29cb5 100644 (file)
@@ -56,7 +56,7 @@ class OrderedStreamingForkController extends ForkController {
        }
 
        /**
-        * {@inheritDoc}
+        * @inheritDoc
         */
        public function start() {
                if ( $this->procsToStart > 0 ) {
index bd1b2a2..c3393bc 100644 (file)
@@ -228,6 +228,7 @@ class Pingback {
         *
         * The schema for the data is located at:
         * <https://meta.wikimedia.org/wiki/Schema:MediaWikiPingback>
+        * @return bool
         */
        public function sendPingback() {
                if ( !$this->acquireLock() ) {
index 8cfeb88..3da6ab9 100644 (file)
@@ -1797,7 +1797,7 @@ class Title implements LinkTarget {
         * @see self::getLocalURL for the arguments.
         * @param array|string $query
         * @param string $proto Protocol type to use in URL
-        * @return String. A url suitable to use in an HTTP location header.
+        * @return string A url suitable to use in an HTTP location header.
         */
        public function getFullUrlForRedirect( $query = '', $proto = PROTO_CURRENT ) {
                $target = $this;
@@ -1975,6 +1975,8 @@ class Title implements LinkTarget {
         * NOTE: Unlike getInternalURL(), the canonical URL includes the fragment
         *
         * @see self::getLocalURL for the arguments.
+        * @param string $query
+        * @param string|bool $query2
         * @return string The URL
         * @since 1.18
         */
index d3ba0aa..c5cd89f 100644 (file)
@@ -153,6 +153,7 @@ class InfoAction extends FormlessAction {
         * Creates a header that can be added to the output.
         *
         * @param string $header The header text.
+        * @param string $canonicalId
         * @return string The HTML.
         */
        protected function makeHeader( $header, $canonicalId ) {
index 611e683..66bedb2 100644 (file)
@@ -85,6 +85,7 @@ class MarkpatrolledAction extends FormAction {
        }
 
        /**
+        * @param array $data
         * @return bool|array True for success, false for didn't-try, array of errors on failure
         */
        public function onSubmit( $data ) {
index a4631d6..0df0ca9 100644 (file)
@@ -216,6 +216,7 @@ class ApiCSPReport extends ApiBase {
 
        /**
         * Mark as internal. This isn't meant to be used by normal api users
+        * @return bool
         */
        public function isInternal() {
                return true;
@@ -223,6 +224,7 @@ class ApiCSPReport extends ApiBase {
 
        /**
         * Even if you don't have read rights, we still want your report.
+        * @return bool
         */
        public function isReadMode() {
                return false;
@@ -232,6 +234,7 @@ class ApiCSPReport extends ApiBase {
         * Doesn't touch db, so max lag should be rather irrelavent.
         *
         * Also, this makes sure that reports aren't lost during lag events.
+        * @return bool
         */
        public function shouldCheckMaxLag() {
                return false;
index 36247dd..06eaa19 100644 (file)
@@ -132,6 +132,7 @@ abstract class ApiFormatBase extends ApiBase {
 
        /**
         * Overridden to honor $this->forceDefaultParams(), if applicable
+        * @inheritDoc
         * @since 1.26
         */
        protected function getParameterFromSettings( $paramName, $paramSettings, $parseLimit ) {
index d2bfd48..3ab5ab9 100644 (file)
@@ -72,6 +72,7 @@ class ApiFormatFeedWrapper extends ApiFormatBase {
         * This class expects the result data to be in a custom format set by self::setResult()
         * $result['_feed'] - an instance of one of the $wgFeedClasses classes
         * $result['_feeditems'] - an array of FeedItem instances
+        * @param bool $unused
         */
        public function initPrinter( $unused = false ) {
                parent::initPrinter( $unused );
index e69300b..1415640 100644 (file)
@@ -1870,7 +1870,7 @@ class ApiMain extends ApiBase {
                ];
        }
 
-       /** @see ApiBase::getExamplesMessages() */
+       /** @inheritDoc */
        protected function getExamplesMessages() {
                return [
                        'action=help'
index fe16134..051d346 100644 (file)
@@ -97,9 +97,7 @@ abstract class ApiQueryBase extends ApiBase {
                return $this->mQueryModule;
        }
 
-       /**
-        * @see ApiBase::getParent()
-        */
+       /** @inheritDoc */
        public function getParent() {
                return $this->getQuery();
        }
index f7b94c7..5acd75f 100644 (file)
@@ -93,12 +93,9 @@ abstract class ApiQueryGeneratorBase extends ApiQueryBase {
                }
        }
 
-       /**
-        * @see ApiBase::getHelpFlags()
-        *
-        * Corresponding messages: api-help-flag-generator
-        */
+       /** @inheritDoc */
        protected function getHelpFlags() {
+               // Corresponding messages: api-help-flag-generator
                $flags = parent::getHelpFlags();
                $flags[] = 'generator';
                return $flags;
index 17655ec..47902a7 100644 (file)
@@ -152,7 +152,7 @@ class ApiUsageException extends UsageException implements ILocalizedException {
        }
 
        /**
-        * @returns ApiMessage
+        * @return ApiMessage
         */
        private function getApiMessage() {
                $errors = $this->status->getErrorsByType( 'error' );
index 0b34a5d..2fc1006 100644 (file)
@@ -309,6 +309,7 @@ abstract class ChangesListFilter {
         * structured UI.
         *
         * This can either be the exact filter, or a new filter that replaces it.
+        * @return bool
         */
        public function isFeatureAvailableOnStructuredUi() {
                return $this->displaysOnStructuredUi();
index 54b04ee..efda596 100644 (file)
@@ -474,6 +474,8 @@ class IcuCollation extends Collation {
        }
 
        /**
+        * @param string $index
+        * @return string
         * @since 1.16.3
         */
        public function getLetterByIndex( $index ) {
@@ -481,6 +483,8 @@ class IcuCollation extends Collation {
        }
 
        /**
+        * @param string $index
+        * @return string
         * @since 1.16.3
         */
        public function getSortKeyByLetterIndex( $index ) {
@@ -488,6 +492,8 @@ class IcuCollation extends Collation {
        }
 
        /**
+        * @param string $index
+        * @return string
         * @since 1.16.3
         */
        public function getFirstLetterCount() {
@@ -496,6 +502,8 @@ class IcuCollation extends Collation {
 
        /**
         * Test if a code point is a CJK (Chinese, Japanese, Korean) character
+        * @param int $codepoint
+        * @return bool
         * @since 1.16.3
         */
        public static function isCjk( $codepoint ) {
index 8791e4c..d60c8e3 100644 (file)
@@ -90,7 +90,7 @@ function utf8ToCodepoint( $char ) {
  * Escape a string for inclusion in a PHP single-quoted string literal.
  *
  * @param string $string string to be escaped.
- * @return String: escaped string.
+ * @return string escaped string.
  * @public
  * @deprecated since 1.25, use UtfNormal\Utils directly
  */
index 589f7d3..6295371 100644 (file)
@@ -46,7 +46,7 @@ class GlobalVarConfig implements Config {
        }
 
        /**
-        * @see Config::get
+        * @inheritDoc
         */
        public function get( $name ) {
                if ( !$this->has( $name ) ) {
@@ -56,7 +56,7 @@ class GlobalVarConfig implements Config {
        }
 
        /**
-        * @see Config::has
+        * @inheritDoc
         */
        public function has( $name ) {
                return $this->hasWithPrefix( $this->prefix, $name );
index 4d6c68c..d020d20 100644 (file)
@@ -49,7 +49,7 @@ class HashConfig implements Config, MutableConfig {
        }
 
        /**
-        * @see Config::get
+        * @inheritDoc
         */
        public function get( $name ) {
                if ( !$this->has( $name ) ) {
@@ -60,7 +60,8 @@ class HashConfig implements Config, MutableConfig {
        }
 
        /**
-        * @see Config::has
+        * @inheritDoc
+        * @since 1.24
         */
        public function has( $name ) {
                return array_key_exists( $name, $this->settings );
@@ -68,6 +69,8 @@ class HashConfig implements Config, MutableConfig {
 
        /**
         * @see MutableConfig::set
+        * @param string $name
+        * @param mixed $value
         */
        public function set( $name, $value ) {
                $this->settings[$name] = $value;
index cbb65aa..2bbc84c 100644 (file)
@@ -45,7 +45,7 @@ class MultiConfig implements Config {
        }
 
        /**
-        * @see Config::get
+        * @inheritDoc
         */
        public function get( $name ) {
                foreach ( $this->configs as $config ) {
@@ -58,7 +58,7 @@ class MultiConfig implements Config {
        }
 
        /**
-        * @see Config::has
+        * @inheritDoc
         */
        public function has( $name ) {
                foreach ( $this->configs as $config ) {
index 1d472e0..c12d28d 100644 (file)
@@ -55,6 +55,7 @@ abstract class AbstractContent implements Content {
         * @since 1.21
         *
         * @see Content::getModel
+        * @return string
         */
        public function getModel() {
                return $this->model_id;
@@ -82,6 +83,7 @@ abstract class AbstractContent implements Content {
         * @since 1.21
         *
         * @see Content::getContentHandler
+        * @return ContentHandler
         */
        public function getContentHandler() {
                return ContentHandler::getForContent( $this );
@@ -91,6 +93,7 @@ abstract class AbstractContent implements Content {
         * @since 1.21
         *
         * @see Content::getDefaultFormat
+        * @return string
         */
        public function getDefaultFormat() {
                return $this->getContentHandler()->getDefaultFormat();
@@ -100,6 +103,7 @@ abstract class AbstractContent implements Content {
         * @since 1.21
         *
         * @see Content::getSupportedFormats
+        * @return string[]
         */
        public function getSupportedFormats() {
                return $this->getContentHandler()->getSupportedFormats();
@@ -334,6 +338,7 @@ abstract class AbstractContent implements Content {
        /**
         * @since 1.21
         *
+        * @param string|int $sectionId
         * @return null
         *
         * @see Content::getSection
@@ -345,6 +350,9 @@ abstract class AbstractContent implements Content {
        /**
         * @since 1.21
         *
+        * @param string|int|null|bool $sectionId
+        * @param Content $with
+        * @param string $sectionTitle
         * @return null
         *
         * @see Content::replaceSection
@@ -356,6 +364,9 @@ abstract class AbstractContent implements Content {
        /**
         * @since 1.21
         *
+        * @param Title $title
+        * @param User $user
+        * @param ParserOptions $popts
         * @return Content $this
         *
         * @see Content::preSaveTransform
@@ -367,6 +378,7 @@ abstract class AbstractContent implements Content {
        /**
         * @since 1.21
         *
+        * @param string $header
         * @return Content $this
         *
         * @see Content::addSectionHeader
@@ -378,6 +390,9 @@ abstract class AbstractContent implements Content {
        /**
         * @since 1.21
         *
+        * @param Title $title
+        * @param ParserOptions $popts
+        * @param array $params
         * @return Content $this
         *
         * @see Content::preloadTransform
@@ -389,6 +404,10 @@ abstract class AbstractContent implements Content {
        /**
         * @since 1.21
         *
+        * @param WikiPage $page
+        * @param int $flags
+        * @param int $parentRevId
+        * @param User $user
         * @return Status
         *
         * @see Content::prepareSave
@@ -405,7 +424,7 @@ abstract class AbstractContent implements Content {
         * @since 1.21
         *
         * @param WikiPage $page
-        * @param ParserOutput $parserOutput
+        * @param ParserOutput|null $parserOutput
         *
         * @return LinksDeletionUpdate[]
         *
index 2a50566..a395e0d 100644 (file)
@@ -61,7 +61,7 @@ class AvroFormatter implements FormatterInterface {
        protected $writer;
 
        /**
-        * @var array $schemas Map from Monolog channel to Avro schema.
+        * @param array $schemas Map from Monolog channel to Avro schema.
         *  Each schema can be either the JSON string or decoded into PHP
         *  arrays.
         */
@@ -120,7 +120,7 @@ class AvroFormatter implements FormatterInterface {
        /**
         * Get the writer for the named channel
         *
-        * @var string $channel Name of the schema to fetch
+        * @param string $channel Name of the schema to fetch
         * @return \AvroSchema|null
         */
        protected function getSchema( $channel ) {
@@ -147,7 +147,7 @@ class AvroFormatter implements FormatterInterface {
        /**
         * Get the writer for the named channel
         *
-        * @var string $channel Name of the schema
+        * @param string $channel Name of the schema
         * @return int|null
         */
        public function getSchemaRevisionId( $channel ) {
index cbeb1fc..2e5298c 100644 (file)
@@ -98,7 +98,7 @@ class WANCacheReapUpdate implements DeferrableUpdate {
         * @see WANObjectCacheRepear
         * @param WANObjectCache $cache
         * @param TitleValue $t
-        * @returns string[]
+        * @return string[]
         */
        public function getEventAffectedKeys( WANObjectCache $cache, TitleValue $t ) {
                /** @var WikiPage[]|LocalFile[]|User[] $entities */
index c1f0651..8e1e49f 100644 (file)
@@ -29,6 +29,9 @@
 class ExternalStoreHttp extends ExternalStoreMedium {
        /**
         * @see ExternalStoreMedium::fetchFromURL()
+        * @param string $url
+        * @return string|bool
+        * @throws MWException
         */
        public function fetchFromURL( $url ) {
                return Http::get( $url, [], __METHOD__ );
@@ -36,6 +39,10 @@ class ExternalStoreHttp extends ExternalStoreMedium {
 
        /**
         * @see ExternalStoreMedium::store()
+        * @param string $cluster
+        * @param string $data
+        * @return string|bool
+        * @throws MWException
         */
        public function store( $cluster, $data ) {
                throw new MWException( "ExternalStoreHttp is read-only and does not support store()." );
index b05843c..5395f56 100644 (file)
@@ -35,6 +35,8 @@ class ExternalStoreMwstore extends ExternalStoreMedium {
         * The URL returned is of the form of the form mwstore://backend/container/wiki/id
         *
         * @see ExternalStoreMedium::fetchFromURL()
+        * @param string $url
+        * @return bool
         */
        public function fetchFromURL( $url ) {
                $be = FileBackendGroup::singleton()->backendFromPath( $url );
@@ -73,6 +75,10 @@ class ExternalStoreMwstore extends ExternalStoreMedium {
 
        /**
         * @see ExternalStoreMedium::store()
+        * @param string $backend
+        * @param string $data
+        * @return string|bool
+        * @throws MWException
         */
        public function store( $backend, $data ) {
                $be = FileBackendGroup::singleton()->get( $backend );
index 0d5a15d..21b7ac2 100644 (file)
@@ -298,6 +298,7 @@ class FileBackendDBRepoWrapper extends FileBackend {
         *
         * @param string $function
         * @param array $params
+        * @return mixed
         */
        protected function translateSrcParams( $function, array $params ) {
                $latest = !empty( $params['latest'] );
index 55a19e8..45a5c82 100644 (file)
@@ -257,7 +257,7 @@ class ForeignAPIRepo extends FileRepo {
         * @param string $name
         * @param int $width
         * @param int $height
-        * @param array $result Out parameter that will be changed by the function.
+        * @param array &$result
         * @param string $otherParams
         *
         * @return bool
index b46e1e4..ee172e1 100644 (file)
@@ -396,6 +396,7 @@ class OldLocalFile extends LocalFile {
         *
         * This is the case for a couple files on Wikimedia servers where
         * the old version is "lost".
+        * @return bool
         */
        public function exists() {
                $archiveName = $this->getArchiveName();
index 3f1c590..dfd18ba 100644 (file)
@@ -660,6 +660,8 @@ abstract class HTMLFormField {
 
        /**
         * Get a FieldLayout (or subclass thereof) to wrap this field in when using OOUI output.
+        * @param string $inputField
+        * @param array $config
         * @return OOUI\FieldLayout|OOUI\ActionFieldLayout
         */
        protected function getFieldLayoutOOUI( $inputField, $config ) {
index c10b312..6eff6c9 100644 (file)
@@ -168,6 +168,7 @@ class Http {
        /**
         * Get a configured MultiHttpClient
         * @param array $options
+        * @return MultiHttpClient
         */
        public static function createMultiClient( $options = [] ) {
                global $wgHTTPConnectTimeout, $wgHTTPTimeout, $wgHTTPProxy;
index 3f3803b..0c5d162 100644 (file)
@@ -88,6 +88,8 @@ class PhpHttpRequest extends MWHttpRequest {
         * so normal methods of handling errors programmatically
         * like get_last_error() don't work.
         * @internal
+        * @param int $errno
+        * @param string $errstr
         */
        public function errorHandler( $errno, $errstr ) {
                $n = count( $this->fopenErrors ) + 1;
index bfb1a69..568ef51 100644 (file)
@@ -30,6 +30,8 @@ use MediaWiki\Session\SessionInfo;
 class InstallerSessionProvider extends SessionProvider {
        /**
         * Pretend there is a session, to avoid MWCryptRand overhead
+        * @param WebRequest $request
+        * @return SessionInfo
         */
        public function provideSessionInfo( WebRequest $request ) {
                return new SessionInfo( 1, [
@@ -40,6 +42,7 @@ class InstallerSessionProvider extends SessionProvider {
 
        /**
         * Yes we will treat your data with great care!
+        * @return bool
         */
        public function persistsSessionId() {
                return true;
@@ -47,6 +50,7 @@ class InstallerSessionProvider extends SessionProvider {
 
        /**
         * Sure, you can be whoever you want, as long as you have ID 0
+        * @return bool
         */
        public function canChangeUser() {
                return true;
index b4de44d..a2aa8c0 100644 (file)
@@ -125,6 +125,7 @@ class MssqlUpdater extends DatabaseUpdater {
         * @param string $updatekey
         * @param string $patch
         * @param bool $fullpath
+        * @return bool
         */
        protected function updateSchema( $table, $updatekey, $patch, $fullpath = false ) {
                if ( !$this->db->tableExists( $table, __METHOD__ ) ) {
index dc63899..c5dd4dc 100644 (file)
@@ -223,6 +223,7 @@ class MysqlInstaller extends DatabaseInstaller {
 
        /**
         * @param string $s
+        * @param string $escapeChar
         * @return string
         */
        protected function escapeLikeInternal( $s, $escapeChar = '`' ) {
@@ -342,6 +343,8 @@ class MysqlInstaller extends DatabaseInstaller {
        /**
         * Convert a wildcard (as used in LIKE) to a regex
         * Slashes are escaped, slash terminators included
+        * @param string $wildcard
+        * @return string
         */
        protected function likeToRegex( $wildcard ) {
                $r = preg_quote( $wildcard, '/' );
index 27300f3..e0e54c8 100644 (file)
@@ -1005,6 +1005,7 @@ class WebInstaller extends Installer {
         *
         * @see getRadioSet
         *
+        * @param mixed[] $params
         * @return array
         */
        public function getRadioElements( $params ) {
index a1935df..4e3409a 100644 (file)
@@ -138,6 +138,7 @@ class JobQueueSecondTestQueue extends JobQueue {
        /**
         * @see JobQueue::ack()
         * @param Job $job
+        * @return Job|bool
         */
        protected function doAck( Job $job ) {
                return $this->mainQueue->doAck( $job );
@@ -172,6 +173,7 @@ class JobQueueSecondTestQueue extends JobQueue {
 
        /**
         * @see JobQueue::delete()
+        * @return bool
         * @throws MWException
         */
        protected function doDelete() {
index 7ce2c74..f26beee 100644 (file)
@@ -79,6 +79,9 @@ abstract class JobQueueAggregator {
 
        /**
         * @see JobQueueAggregator::notifyQueueEmpty()
+        * @param string $wiki
+        * @param string $type
+        * @return bool
         */
        abstract protected function doNotifyQueueEmpty( $wiki, $type );
 
@@ -97,6 +100,9 @@ abstract class JobQueueAggregator {
 
        /**
         * @see JobQueueAggregator::notifyQueueNonEmpty()
+        * @param string $wiki
+        * @param string $type
+        * @return bool
         */
        abstract protected function doNotifyQueueNonEmpty( $wiki, $type );
 
index 3bfb531..1c48f49 100644 (file)
@@ -510,7 +510,7 @@ class IP {
         *     2001:0db8:85a3::7344 - 2001:0db8:85a3::7344   Explicit range
         *     2001:0db8:85a3::7344                          Single IP
         * @param string $range IP range
-        * @return array(string, string)
+        * @return array [ string, string ]
         */
        public static function parseRange( $range ) {
                // CIDR notation
index 90c7a64..14462f1 100644 (file)
@@ -75,6 +75,7 @@ class MemoizedCallable {
         *
         * @param string $key
         * @param bool &$success
+        * @return bool
         */
        protected function fetchResult( $key, &$success ) {
                $success = false;
@@ -148,6 +149,7 @@ class MemoizedCallable {
         * @param callable $callable
         * @param array $args
         * @param int $ttl
+        * @return mixed
         */
        public static function call( $callable, array $args = [], $ttl = 3600 ) {
                $instance = new self( $callable, $ttl );
index 016c9b1..e58d98f 100644 (file)
@@ -37,6 +37,7 @@ class Xhprof {
 
        /**
         * Start xhprof profiler
+        * @return bool
         */
        public static function isEnabled() {
                return self::$enabled;
@@ -44,6 +45,9 @@ class Xhprof {
 
        /**
         * Start xhprof profiler
+        * @param int $flags
+        * @param array $options
+        * @throws Exception
         */
        public static function enable( $flags = 0, $options = [] ) {
                if ( self::isEnabled() ) {
index 2383d2a..0be4ff6 100644 (file)
@@ -107,6 +107,7 @@ class XhprofData {
         * The resulting array is left padded with nulls, so a key
         * with no parent (eg 'main()') will return [null, 'function'].
         *
+        * @param string $key
         * @return array
         */
        public static function splitKey( $key ) {
index dfc7c4b..e9fb11f 100644 (file)
@@ -333,7 +333,7 @@ class IEContentAnalyzer {
         * @param string $chunk the first 256 bytes of the file
         * @param string $proposed the MIME type proposed by the server
         *
-        * @return Array: map of IE version to detected MIME type
+        * @return array map of IE version to detected MIME type
         */
        public function getRealMimesFromData( $fileName, $chunk, $proposed ) {
                $types = $this->getMimesFromData( $fileName, $chunk, $proposed );
@@ -371,7 +371,7 @@ class IEContentAnalyzer {
         * @param string $chunk the first 256 bytes of the file
         * @param string $proposed the MIME type proposed by the server
         *
-        * @return Array: map of IE version to detected MIME type
+        * @return array map of IE version to detected MIME type
         */
        public function getMimesFromData( $fileName, $chunk, $proposed ) {
                $types = [];
index 64fbea3..2c66d74 100644 (file)
@@ -2106,6 +2106,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
 
        /**
         * @param string $s
+        * @param string $escapeChar
         * @return string
         */
        protected function escapeLikeInternal( $s, $escapeChar = '`' ) {
@@ -2416,6 +2417,15 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
         * we don't want to select everything into memory
         *
         * @see IDatabase::insertSelect()
+        * @param string $destTable
+        * @param string|array $srcTable
+        * @param array $varMap
+        * @param array $conds
+        * @param string $fname
+        * @param array $insertOptions
+        * @param array $selectOptions
+        * @param array $selectJoinConds
+        * @return bool
         */
        protected function nativeInsertSelect( $destTable, $srcTable, $varMap, $conds,
                $fname = __METHOD__,
index 8f3cab8..4ebc623 100644 (file)
@@ -1110,6 +1110,7 @@ class DatabaseMssql extends Database {
         * MS SQL supports more pattern operators than other databases (ex: [,],^)
         *
         * @param string $s
+        * @param string $escapeChar
         * @return string
         */
        protected function escapeLikeInternal( $s, $escapeChar = '`' ) {
index ac59bd6..672b345 100644 (file)
@@ -1158,8 +1158,8 @@ SQL;
        }
 
        /**
-        * @var string $table
-        * @var string $field
+        * @param string $table
+        * @param string $field
         * @return PostgresField|null
         */
        public function fieldInfo( $table, $field ) {
index 7369751..d346f65 100644 (file)
@@ -40,8 +40,8 @@ class NullStatsdDataFactory implements IBufferingStatsdDataFactory {
         * and logged in users by sending the current userId of a user
         * with each request with a key of "uniques" (or similar).
         *
-        * @param  string|array $key The metric(s) to set.
-        * @param  float $value The value for the stats.
+        * @param string|array $key The metric(s) to set.
+        * @param float $value The value for the stats.
         *
         * @return array
         */
index a148a39..64d1a82 100644 (file)
@@ -147,6 +147,10 @@ class ParsoidVirtualRESTService extends VirtualRESTService {
         * Visual Editor "pretends" the V1 API is like.  A previous version of
         * ParsoidVirtualRESTService translated these to the "real" Parsoid v1
         * API.  We now translate these to the "real" Parsoid v3 API.
+        * @param array $req
+        * @param Closure $idGeneratorFunc
+        * @return array
+        * @throws Exception
         */
        public function onParsoid1Request( array $req, Closure $idGeneratorFunc ) {
                $parts = explode( '/', $req['url'] );
index 90865ff..192b4bd 100644 (file)
@@ -112,6 +112,10 @@ class RestbaseVirtualRESTService extends VirtualRESTService {
 
        /**
         * Remaps Parsoid v1/v3 requests to RESTBase v1 requests.
+        * @param array $reqs
+        * @param Closure $idGeneratorFunc
+        * @return array
+        * @throws Exception
         */
        public function onParsoidRequests( array $reqs, Closure $idGeneratorFunc ) {
                $result = [];
@@ -145,6 +149,10 @@ class RestbaseVirtualRESTService extends VirtualRESTService {
         * NOTE: the POST APIs aren't "real" Parsoid v1 APIs, they are just what
         * Visual Editor "pretends" the V1 API is like.  (See
         * ParsoidVirtualRESTService.)
+        * @param array $req
+        * @param Closure $idGeneratorFunc
+        * @return array
+        * @throws Exception
         */
        public function onParsoid1Request( array $req, Closure $idGeneratorFunc ) {
                $parts = explode( '/', $req['url'] );
@@ -233,6 +241,10 @@ class RestbaseVirtualRESTService extends VirtualRESTService {
         *   * body: array( 'wikitext' => ... ) or array( 'wikitext' => ..., 'body_only' => true/false )
         *   * $title is optional
         *   * $revision is optional
+        * @param array $req
+        * @param Closure $idGeneratorFunc
+        * @return array
+        * @throws Exception
         */
        public function onParsoid3Request( array $req, Closure $idGeneratorFunc ) {
                $parts = explode( '/', $req['url'] );
index e12766a..c46acc6 100644 (file)
@@ -131,6 +131,7 @@ class XMPReader implements LoggerAwareInterface {
 
        /**
         * Primary job is to initialize the XMLParser
+        * @param LoggerInterface|null $logger
         */
        function __construct( LoggerInterface $logger = null ) {
                if ( !function_exists( 'xml_parser_create_ns' ) ) {
@@ -189,6 +190,7 @@ class XMPReader implements LoggerAwareInterface {
 
        /**
         * Check if this instance supports using this class
+        * @return bool
         */
        public static function isSupported() {
                return function_exists( 'xml_parser_create_ns' ) && class_exists( 'XMLReader' );
index 3e4731a..e23989d 100644 (file)
@@ -299,6 +299,8 @@ class WebPHandler extends BitmapHandler {
        /**
         * Must use "im" for XCF
         *
+        * @param string $dstPath
+        * @param bool $checkDstPath
         * @return string
         */
        protected function getScalerType( $dstPath, $checkDstPath = true ) {
index bf8a597..9491902 100644 (file)
@@ -213,6 +213,7 @@ class WikiPage implements Page, IDBAccessObject {
         * @todo Move this UI stuff somewhere else
         *
         * @see ContentHandler::getActionOverrides
+        * @return array
         */
        public function getActionOverrides() {
                return $this->getContentHandler()->getActionOverrides();
@@ -2732,6 +2733,7 @@ class WikiPage implements Page, IDBAccessObject {
         * @param array|string &$error Array of errors to append to
         * @param User $user The deleting user
         * @param array $tags Tags to apply to the deletion action
+        * @param string $logsubtype
         * @return Status Status object; if successful, $status->value is the log_id of the
         *   deletion log entry. If the page couldn't be deleted because it wasn't
         *   found, $status is a non-fatal 'cannotdelete' error
index 2dd4085..2981748 100644 (file)
@@ -243,6 +243,7 @@ class ParserOutput extends CacheTime {
         * return value is suitable for writing back via setText() but is not valid
         * for display to the user.
         *
+        * @return string
         * @since 1.27
         */
        public function getRawText() {
@@ -298,7 +299,10 @@ class ParserOutput extends CacheTime {
                $this->mSpeculativeRevId = $id;
        }
 
-       /** @since 1.28 */
+       /**
+        * @return int|null
+        * @since 1.28
+        */
        public function getSpeculativeRevIdUsed() {
                return $this->mSpeculativeRevId;
        }
@@ -320,6 +324,7 @@ class ParserOutput extends CacheTime {
        }
 
        /**
+        * @return array
         * @since 1.25
         */
        public function getIndicators() {
@@ -382,7 +387,10 @@ class ParserOutput extends CacheTime {
                return $this->mModuleStyles;
        }
 
-       /** @since 1.23 */
+       /**
+        * @return array
+        * @since 1.23
+        */
        public function getJsConfigVars() {
                return $this->mJsConfigVars;
        }
@@ -471,6 +479,8 @@ class ParserOutput extends CacheTime {
        }
 
        /**
+        * @param string $id
+        * @param string $content
         * @since 1.25
         */
        public function setIndicator( $id, $content ) {
@@ -836,6 +846,8 @@ class ParserOutput extends CacheTime {
         * @code
         *    $parser->getOutput()->my_ext_foo = '...';
         * @endcode
+        * @param string $name
+        * @param mixed $value
         */
        public function setProperty( $name, $value ) {
                $this->mProperties[$name] = $value;
index 24474d5..627d112 100644 (file)
@@ -62,6 +62,7 @@ abstract class Preprocessor {
         *
         * @param string $text
         * @param int $flags
+        * @param string $tree
         */
        protected function cacheSetTree( $text, $flags, $tree ) {
                $config = RequestContext::getMain()->getConfig();
index 8e84cb2..332f8e9 100644 (file)
@@ -1869,6 +1869,8 @@ class PPNode_Hash_Tree implements PPNode {
 
        /**
         * Like splitArg() but for a raw child array. For internal use only.
+        * @param array $children
+        * @return array
         */
        public static function splitRawArg( array $children ) {
                $bits = [];
@@ -1910,6 +1912,8 @@ class PPNode_Hash_Tree implements PPNode {
 
        /**
         * Like splitExt() but for a raw child array. For internal use only.
+        * @param array $children
+        * @return array
         */
        public static function splitRawExt( array $children ) {
                $bits = [];
@@ -1953,6 +1957,8 @@ class PPNode_Hash_Tree implements PPNode {
 
        /**
         * Like splitHeading() but for a raw child array. For internal use only.
+        * @param array $children
+        * @return array
         */
        public static function splitRawHeading( array $children ) {
                $bits = [];
@@ -1984,6 +1990,8 @@ class PPNode_Hash_Tree implements PPNode {
 
        /**
         * Like splitTemplate() but for a raw child array. For internal use only.
+        * @param array $children
+        * @return array
         */
        public static function splitRawTemplate( array $children ) {
                $parts = [];
index 10ba83f..531a3eb 100644 (file)
 class IRCColourfulRCFeedFormatter implements RCFeedFormatter {
        /**
         * @see RCFeedFormatter::getLine
+        * @param array $feed
+        * @param RecentChange $rc
+        * @param string|null $actionComment
+        * @return string|null
         */
        public function getLine( array $feed, RecentChange $rc, $actionComment ) {
                global $wgUseRCPatrol, $wgUseNPPatrol, $wgLocalInterwikis,
index 20f88bd..a90d648 100644 (file)
@@ -36,6 +36,10 @@ abstract class MachineReadableRCFeedFormatter implements RCFeedFormatter {
        /**
         * Generates a notification that can be easily interpreted by a machine.
         * @see RCFeedFormatter::getLine
+        * @param array $feed
+        * @param RecentChange $rc
+        * @param string|null $actionComment
+        * @return string|null
         */
        public function getLine( array $feed, RecentChange $rc, $actionComment ) {
                global $wgCanonicalServer, $wgServerName, $wgScriptPath;
index f0fcd7d..3abc9c1 100644 (file)
@@ -41,6 +41,9 @@ class RedisPubSubFeedEngine extends RCFeedEngine {
 
        /**
         * @see FormattedRCFeed::send
+        * @param array $feed
+        * @param string $line
+        * @return bool
         */
        public function send( array $feed, $line ) {
                $parsed = wfParseUrl( $feed['uri'] );
index 61ced5f..f76d771 100644 (file)
@@ -25,6 +25,9 @@
 class UDPRCFeedEngine extends RCFeedEngine {
        /**
         * @see RCFeedEngine::send
+        * @param array $feed
+        * @param string $line
+        * @return bool
         */
        public function send( array $feed, $line ) {
                $transport = UDPTransport::newFromString( $feed['uri'] );
index d26c961..cbcf5a0 100644 (file)
@@ -427,6 +427,8 @@ class ResourceLoaderImageModule extends ResourceLoaderModule {
 
        /**
         * Helper method for getDefinitionSummary.
+        * @param ResourceLoaderContext $context
+        * @return array
         */
        protected function getFileHashes( ResourceLoaderContext $context ) {
                $this->loadFromDefinition();
index 08641b0..236112e 100644 (file)
@@ -43,6 +43,7 @@ class ResourceLoaderSiteModule extends ResourceLoaderWikiModule {
        }
 
        /**
+        * @param ResourceLoaderContext|null $context
         * @return array
         */
        public function getDependencies( ResourceLoaderContext $context = null ) {
index d535ffc..8b9feeb 100644 (file)
@@ -297,6 +297,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
        }
 
        /**
+        * @param ResourceLoaderContext $context
         * @return array
         */
        public function getPreloadLinks( ResourceLoaderContext $context ) {
index 9377ed6..1a390cf 100644 (file)
@@ -30,6 +30,7 @@ class ResourceLoaderUploadDialogModule extends ResourceLoaderModule {
        protected $targets = [ 'desktop', 'mobile' ];
 
        /**
+        * @param ResourceLoaderContext $context
         * @return string JavaScript code
         */
        public function getScript( ResourceLoaderContext $context ) {
index 8f58040..8e21381 100644 (file)
@@ -78,6 +78,7 @@ class ResourceLoaderUserModule extends ResourceLoaderWikiModule {
        }
 
        /**
+        * @param ResourceLoaderContext|null $context
         * @return array
         */
        public function getDependencies( ResourceLoaderContext $context = null ) {
index df653f1..4b60a0c 100644 (file)
@@ -31,6 +31,7 @@ class ParserOutputSearchDataExtractor {
        /**
         * Get a list of categories, as an array with title text strings.
         *
+        * @param ParserOutput $parserOutput
         * @return string[]
         */
        public function getCategories( ParserOutput $parserOutput ) {
@@ -46,6 +47,7 @@ class ParserOutputSearchDataExtractor {
        /**
         * Get a list of external links from ParserOutput, as an array of strings.
         *
+        * @param ParserOutput $parserOutput
         * @return string[]
         */
        public function getExternalLinks( ParserOutput $parserOutput ) {
@@ -56,6 +58,7 @@ class ParserOutputSearchDataExtractor {
         * Get a list of outgoing wiki links (including interwiki links), as
         * an array of prefixed title strings.
         *
+        * @param ParserOutput $parserOutput
         * @return string[]
         */
        public function getOutgoingLinks( ParserOutput $parserOutput ) {
@@ -74,6 +77,7 @@ class ParserOutputSearchDataExtractor {
        /**
         * Get a list of templates used in the ParserOutput content, as prefixed title strings
         *
+        * @param ParserOutput $parserOutput
         * @return string[]
         */
        public function getTemplates( ParserOutput $parserOutput ) {
index 7c2f0f2..3c8fe60 100644 (file)
@@ -269,7 +269,7 @@ abstract class SearchEngine {
         * might support more. The default in all implementations should be 'relevance.'
         *
         * @since 1.25
-        * @return array(string) the valid sort directions for setSort
+        * @return string[] the valid sort directions for setSort
         */
        public function getValidSorts() {
                return [ 'relevance' ];
index 89d2299..f25c728 100644 (file)
@@ -152,6 +152,7 @@ class SearchResultSet {
        /**
         * Return a result set of hits on other (multiple) wikis associated with this one
         *
+        * @param int $type
         * @return SearchResultSet[]
         */
        function getInterwikiResults( $type = self::SECONDARY_RESULTS ) {
@@ -161,6 +162,7 @@ class SearchResultSet {
        /**
         * Check if there are results on other wikis
         *
+        * @param int $type
         * @return bool
         */
        function hasInterwikiResults( $type = self::SECONDARY_RESULTS ) {
index 6d54dad..aced5e1 100644 (file)
@@ -106,6 +106,7 @@ class SearchSuggestionSet {
 
        /**
         * Move the suggestion at index $key to the first position
+        * @param string $key
         */
        public function rescore( $key ) {
                $removed = array_splice( $this->suggestions, $key, 1 );
index 5831b09..a588aee 100644 (file)
@@ -167,6 +167,7 @@ class BotPasswordSessionProvider extends ImmutableSessionProviderWithCookie {
 
        /**
         * @codeCoverageIgnore
+        * @inheritDoc
         */
        public function preventSessionsForUser( $username ) {
                BotPassword::removeAllPasswordsForUser( $username );
index 12f16b6..23d9ab3 100644 (file)
@@ -654,6 +654,7 @@ final class Session implements \Countable, \Iterator, \ArrayAccess {
        /**
         * @note Despite the name, this seems to be intended to implement isset()
         *  rather than array_key_exists(). So do that.
+        * @inheritDoc
         */
        public function offsetExists( $offset ) {
                $data = &$this->backend->getData();
@@ -666,6 +667,7 @@ final class Session implements \Countable, \Iterator, \ArrayAccess {
         *  data to detect such changes.
         * @note Accessing a nonexistent key via this mechanism causes that key to
         *  be created with a null value, and does not raise a PHP warning.
+        * @inheritDoc
         */
        public function &offsetGet( $offset ) {
                $data = &$this->backend->getData();
index 2c7965c..6d98e72 100644 (file)
@@ -113,6 +113,7 @@ class HashSiteStore implements SiteStore {
        /**
         * Deletes all sites from the database. After calling clear(), getSites() will return an empty
         * list and getSite() will return null until saveSite() or saveSites() is called.
+        * @return bool
         */
        public function clear() {
                $this->sites = [];
index 180a6df..4fcc865 100644 (file)
@@ -811,6 +811,9 @@ class SkinTemplate extends Skin {
 
        /**
         * @todo is this even used?
+        * @param string $name
+        * @param string $urlaction
+        * @return array
         */
        function makeArticleUrlDetails( $name, $urlaction = '' ) {
                $title = Title::newFromText( $name );
index 04d03f5..d943d03 100644 (file)
@@ -808,6 +808,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
         * ChangesListFilterGroup constructors.
         *
         * There is light processing to simplify core maintenance.
+        * @param array $definition
         */
        protected function registerFiltersFromDefinitions( array $definition ) {
                $autoFillPriority = -1;
index d3e22a0..8d39c99 100644 (file)
@@ -35,6 +35,7 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage {
 
        /**
         * @param string|null $subpage
+        * @return Title|bool
         */
        public function execute( $subpage ) {
                $redirect = $this->getRedirect( $subpage );
index 5318895..8b60387 100644 (file)
@@ -102,6 +102,7 @@ abstract class WantedQueryPage extends QueryPage {
         * @note This will only be run if the page is cached (ie $wgMiserMode = true)
         *   unless forceExistenceCheck() is true.
         * @since 1.24
+        * @param Title $title
         * @return bool
         */
        protected function existenceCheck( Title $title ) {
index 4d84e31..f9c917d 100644 (file)
@@ -341,7 +341,7 @@ class SpecialAllPages extends IncludableSpecialPage {
        /**
         * @param int $ns The namespace of the article
         * @param string $text The name of the article
-        * @return array( int namespace, string dbkey, string pagename ) or null on error
+        * @return array|null [ int namespace, string dbkey, string pagename ] or null on error
         */
        protected function getNamespaceKeyAndText( $ns, $text ) {
                if ( $text == '' ) {
index 252dc68..cd3c028 100644 (file)
@@ -484,7 +484,7 @@ class SpecialBlock extends FormSpecialPage {
         * @param string $par Subpage parameter passed to setup, or data value from
         *     the HTMLForm
         * @param WebRequest $request Optionally try and get data from a request too
-        * @return array( User|string|null, Block::TYPE_ constant|null )
+        * @return array [ User|string|null, Block::TYPE_ constant|null ]
         */
        public static function getTargetAndType( $par, WebRequest $request = null ) {
                $i = 0;
index dae6074..cda0854 100644 (file)
@@ -266,6 +266,7 @@ class LinkSearchPage extends QueryPage {
         *
         * @see T130058
         * @todo FIXME This special page should not use LIMIT for paging
+        * @return int
         */
        protected function getMaxResults() {
                return max( parent::getMaxResults(), 60000 );
index 61590d7..edfaa7c 100644 (file)
@@ -294,7 +294,7 @@ class SpecialNewpages extends IncludableSpecialPage {
        }
 
        /**
-        * @param stdClass $row Result row from recent changes
+        * @param stdClass $result Result row from recent changes
         * @return Revision|bool
         */
        protected function revisionFromRcResult( stdClass $result ) {
index 86bc7ed..b159fff 100644 (file)
@@ -21,6 +21,7 @@ class SpecialUnlinkAccounts extends AuthManagerSpecialPage {
 
        /**
         * Under which header this special page is listed in Special:SpecialPages.
+        * @return string
         */
        protected function getGroupName() {
                return 'users';
index d0eb8e3..b98fad1 100644 (file)
@@ -839,6 +839,7 @@ class SpecialUpload extends SpecialPage {
         * This controls js: mw.config.get( 'wgFileCanRotate' )
         *
         * @todo What about non-BitmapHandler handled files?
+        * @return bool
         */
        public static function rotationEnabled() {
                $bitmapHandler = new BitmapHandler();
index 6d481f8..2ebbc2d 100644 (file)
@@ -74,6 +74,7 @@ class WantedFilesPage extends WantedQueryPage {
         * In its own function to allow subclasses to override.
         * @see SpecialWantedFilesGUOverride in GlobalUsage extension.
         * @since 1.24
+        * @return bool
         */
        protected function likelyToHaveFalsePositives() {
                return RepoGroup::singleton()->hasForeignRepos();
@@ -99,6 +100,7 @@ class WantedFilesPage extends WantedQueryPage {
         * Use wfFindFile so we still think file namespace pages without
         * files are missing, but valid file redirects and foreign files are ok.
         *
+        * @param Title $title
         * @return bool
         */
        protected function existenceCheck( Title $title ) {
index 947a572..fbe9270 100644 (file)
@@ -627,6 +627,7 @@ class BalanceElement {
 
        /**
         * Get a string key for the Noah's Ark algorithm
+        * @return string
         */
        public function getNoahKey() {
                if ( $this->noahKey === null ) {
@@ -710,6 +711,7 @@ class BalanceStack implements IteratorAggregate {
        /**
         * Insert a comment at the appropriate place for inserting a node.
         * @param string $value Content of the comment.
+        * @return string
         * @see https://html.spec.whatwg.org/multipage/syntax.html#insert-a-comment
         */
        public function insertComment( $value ) {
@@ -721,6 +723,7 @@ class BalanceStack implements IteratorAggregate {
         * Insert text at the appropriate place for inserting a node.
         * @param string $value
         * @param bool $isComment
+        * @return string
         * @see https://html.spec.whatwg.org/multipage/syntax.html#appropriate-place-for-inserting-a-node
         */
        public function insertText( $value, $isComment = false ) {
@@ -901,6 +904,8 @@ class BalanceStack implements IteratorAggregate {
 
        /**
         * Return the adjusted current node.
+        * @param string $fragmentContext
+        * @return string
         */
        public function adjustedCurrentNode( $fragmentContext ) {
                return ( $fragmentContext && count( $this->elements ) === 1 ) ?
@@ -1513,6 +1518,8 @@ class BalanceActiveFormattingElements {
         * Find and return the last element with the specified tag between the
         * end of the list and the last marker on the list.
         * Used when parsing &lt;a&gt; "in body mode".
+        * @param string $tag
+        * @return null|Node
         */
        public function findElementByTag( $tag ) {
                $elt = $this->tail;
index 6e01894..f88b673 100644 (file)
@@ -14,6 +14,7 @@ abstract class TidyDriverBase {
 
        /**
         * Return true if validate() can be used
+        * @return bool
         */
        public function supportsValidate() {
                return false;
index 19f5100..4f639c1 100644 (file)
@@ -321,7 +321,7 @@ class ClassCollector {
        protected $alias;
 
        /**
-        * @var string $code PHP code (including <?php) to detect class names from
+        * @param string $code PHP code (including <?php) to detect class names from
         * @return array List of FQCN detected within the tokens
         */
        public function getClasses( $code ) {
index 6d0368c..67c0ca7 100644 (file)
@@ -662,7 +662,7 @@ class LanguageConverter {
         *
         * @param string $text Text to be converted
         * @param string $variant The target variant code
-        * @param int $startPos
+        * @param int &$startPos
         * @param int $depth Depth of recursion
         *
         * @throws MWException
index 89e8089..ecbbb85 100644 (file)
@@ -1244,8 +1244,8 @@ abstract class Maintenance {
         * This function has the same parameters as wfGetDB()
         *
         * @param int $db DB index (DB_REPLICA/DB_MASTER)
-        * @param array $groups; default: empty array
-        * @param string|bool $wiki; default: current wiki
+        * @param array $groups default: empty array
+        * @param string|bool $wiki default: current wiki
         * @return IMaintainableDatabase
         */
        protected function getDB( $db, $groups = [], $wiki = false ) {
index 1ebc4f6..04158ae 100644 (file)
@@ -35,6 +35,7 @@ class AddSite extends Maintenance {
        /**
         * Imports the site described by the parameters (see self::__construct()) passed to this
         * maintenance sccript into the sites table of MediaWiki.
+        * @return bool
         */
        public function execute() {
                $siteStore = MediaWikiServices::getInstance()->getSiteStore();
index 94b7fb4..6128d23 100644 (file)
@@ -69,6 +69,8 @@ class DeprecatedInterfaceFinder extends FileAwareNodeVisitor {
        /**
         * Check whether a function or method includes a call to wfDeprecated(),
         * indicating that it is a hard-deprecated interface.
+        * @param PhpParser\Node $node
+        * @return bool
         */
        public function isHardDeprecated( PhpParser\Node $node ) {
                if ( !$node->stmts ) {
index d273a6a..26a9c39 100644 (file)
@@ -410,7 +410,7 @@ class GenerateSitemap extends Maintenance {
        /**
         * gzwrite() / fwrite() wrapper
         *
-        * @param resource $handle
+        * @param resource &$handle
         * @param string $str
         */
        function write( &$handle, $str ) {
@@ -427,7 +427,7 @@ class GenerateSitemap extends Maintenance {
        /**
         * gzclose() / fclose() wrapper
         *
-        * @param resource $handle
+        * @param resource &$handle
         */
        function close( &$handle ) {
                if ( $this->compress ) {
index 4313806..9d4e261 100644 (file)
@@ -222,7 +222,7 @@ class MigrateComments extends LoggedUpdateMaintenance {
         * comment ID field.
         * Blanks the old fields while migrating.
         *
-        * @param string $oldTable Table to migrate
+        * @param string $table Table to migrate
         * @param string $primaryKey Primary key of the table.
         * @param string $oldField Old comment field name
         * @param string $newPrimaryKey Primary key of the new table.
index 01cf3c3..8ac7f91 100644 (file)
@@ -106,6 +106,7 @@ class UserOptions {
 
        /**
         * Dumb stuff to run a mode.
+        * @return bool
         */
        public function run() {
                if ( !$this->mReady ) {
index 5457696..81473df 100644 (file)
@@ -234,7 +234,7 @@ class MWHttpRequestTestCase extends PHPUnit_Framework_TestCase {
 
        /**
         * Asserts that the cookie jar does not have the given cookie.
-        * @param string $expectedName Cookie name
+        * @param string $name Cookie name
         * @param CookieJar $cookieJar
         */
        protected function assertNotHasCookie( $name, CookieJar $cookieJar ) {
index 784c29c..33aee7d 100644 (file)
@@ -29,6 +29,8 @@ class DbTestPreviewer extends TestRecorder {
 
        /**
         * This should be called before the table prefix is changed
+        * @param IDatabase $db
+        * @param bool|string $filter
         */
        function __construct( $db, $filter = false ) {
                $this->db = $db;
index ac9f150..94d226c 100644 (file)
@@ -280,6 +280,7 @@ class ParserTestPrinter extends TestRecorder {
 
        /**
         * Show a warning to the user
+        * @param string $message
         */
        public function warning( $message ) {
                echo "$message\n";
@@ -287,6 +288,8 @@ class ParserTestPrinter extends TestRecorder {
 
        /**
         * Mark a test skipped
+        * @param string $test
+        * @param string $subtest
         */
        public function skipped( $test, $subtest ) {
                if ( $this->showProgress ) {
index 37ed85f..61aa0d7 100644 (file)
@@ -78,6 +78,7 @@ class ParserTestResultNormalizer {
 
        /**
         * Serialize the XML DOM for comparison purposes. This does not generate HTML.
+        * @return string
         */
        protected function serialize() {
                return strtr( $this->doc->saveXML( $this->body ),
index 46c551b..298a3c1 100644 (file)
@@ -518,6 +518,8 @@ class ParserTestRunner {
        /**
         * Ensure a given setup stage has been done, throw an exception if it has
         * not.
+        * @param string $funcName
+        * @param string|null $funcName2
         */
        protected function checkSetupDone( $funcName, $funcName2 = null ) {
                if ( !$this->setupDone[$funcName]
@@ -700,6 +702,8 @@ class ParserTestRunner {
        /**
         * Determine whether the current parser has the hooks registered in it
         * that are required by a file read by TestFileReader.
+        * @param array $requirements
+        * @return bool
         */
        public function meetsRequirements( $requirements ) {
                foreach ( $requirements as $requirement ) {
index 238d018..2f82ca7 100644 (file)
@@ -9,6 +9,8 @@ class PhpunitTestRecorder extends TestRecorder {
 
        /**
         * Mark a test skipped
+        * @param string $test
+        * @param string $reason
         */
        public function skipped( $test, $reason ) {
                $this->testCase->markTestSkipped( "SKIPPED: $reason" );
index 39c9ca5..6aed02f 100644 (file)
@@ -29,6 +29,7 @@ class TidySupport {
 
        /**
         * Determine if there is a usable tidy.
+        * @param bool $useConfiguration
         */
        public function __construct( $useConfiguration = false ) {
                global $IP, $wgUseTidy, $wgTidyBin, $wgTidyInternal, $wgTidyConfig,
index 91aaff5..f04eec7 100644 (file)
@@ -213,6 +213,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         *
         * @param Config|null $bootstrapConfig The bootstrap config to use with the new
         *        MediaWikiServices.
+        * @return MediaWikiServices
         */
        protected static function resetGlobalServices( Config $bootstrapConfig = null ) {
                $oldServices = MediaWikiServices::getInstance();
@@ -1591,7 +1592,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         *
         * @since 1.20
         *
-        * @param array $array
+        * @param array &$array
         */
        protected function objectAssociativeSort( array &$array ) {
                uasort(
@@ -1609,7 +1610,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         *
         * @since 1.20
         *
-        * @param mixed $r The array to remove string keys from.
+        * @param mixed &$r The array to remove string keys from.
         */
        protected static function stripStringKeys( &$r ) {
                if ( !is_array( $r ) ) {
@@ -1832,6 +1833,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
 
        /**
         * Used as a marker to prevent wfResetOutputBuffers from breaking PHPUnit.
+        * @param string $buffer
         * @return string
         */
        public static function wfResetOutputBuffersBarrier( $buffer ) {
index f75cc22..1024ecd 100644 (file)
@@ -17,6 +17,7 @@ abstract class ResourceLoaderTestCase extends MediaWikiTestCase {
         * - string 'modules' Pipe-separated list of module names
         * - string|null 'only' "scripts" (unwrapped script), "styles" (stylesheet), or null
         *    (mw.loader.implement).
+        * @param ResourceLoader|null $rl
         * @return ResourceLoaderContext
         */
        protected function getResourceLoaderContext( $options = [], ResourceLoader $rl = null ) {
index 9ed8f15..d19d998 100644 (file)
@@ -53,6 +53,7 @@ class DatabaseTestHelper extends Database {
        /**
         * Returns SQL queries grouped by '; '
         * Clear the list of queries that have been done so far.
+        * @return string
         */
        public function getLastSqls() {
                $lastSqls = implode( '; ', $this->lastSqls );
index 2f7b767..e7cfca7 100644 (file)
@@ -15,7 +15,7 @@ class SpecialPageExecutor {
         * @param User|null $user The user which should be used in the context of this special page
         *
         * @throws Exception
-        * @return array( string, WebResponse ) A two-elements array containing the HTML output
+        * @return array [ string, WebResponse ] A two-elements array containing the HTML output
         * generated by the special page as well as the response object.
         */
        public function executeSpecialPage(
index 2f091d5..930bbe4 100644 (file)
@@ -51,7 +51,7 @@ abstract class SpecialPageTestBase extends MediaWikiTestCase {
         * @param User|null $user The user which should be used in the context of this special page
         *
         * @throws Exception
-        * @return array( string, WebResponse ) A two-elements array containing the HTML output
+        * @return array [ string, WebResponse ] A two-elements array containing the HTML output
         * generated by the special page as well as the response object.
         */
        protected function executeSpecialPage(
index d712254..6b9b782 100644 (file)
@@ -34,6 +34,7 @@ class DummyContentHandlerForTesting extends ContentHandler {
 
        /**
         * Creates an empty Content object of the type supported by this ContentHandler.
+        * @return DummyContentForTesting
         */
        public function makeEmptyContent() {
                return new DummyContentForTesting( '' );
index 098181d..9d91d4a 100644 (file)
@@ -34,6 +34,7 @@ class DummyNonTextContentHandler extends DummyContentHandlerForTesting {
 
        /**
         * Creates an empty Content object of the type supported by this ContentHandler.
+        * @return DummyNonTextContent
         */
        public function makeEmptyContent() {
                return new DummyNonTextContent( '' );
index 047c03a..ef1caa5 100644 (file)
@@ -41,6 +41,7 @@ class MockFSFile extends FSFile {
        /**
         * August 22 – The theft of the Mona Lisa is discovered in the Louvre."
         * T22281
+        * @return int
         */
        public function getSize() {
                return 1911;