From: Umherirrender Date: Sat, 9 Sep 2017 20:47:04 +0000 (+0200) Subject: Improve some parameter docs X-Git-Tag: 1.31.0-rc.0~2159^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=f739a8f368ab64d63a2f21d15caf2caa766d6fc5 Improve some parameter docs Add missing @return and @param to function docs and fixed some @param Change-Id: I810727961057cfdcc274428b239af5975c57468d --- diff --git a/includes/AjaxDispatcher.php b/includes/AjaxDispatcher.php index 2adbc80f3b..75fcff3654 100644 --- a/includes/AjaxDispatcher.php +++ b/includes/AjaxDispatcher.php @@ -56,6 +56,7 @@ class AjaxDispatcher { /** * Load up our object with user supplied data + * @param Config $config */ function __construct( Config $config ) { $this->config = $config; diff --git a/includes/Block.php b/includes/Block.php index 40095f18b8..5a4c43e6ae 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -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() { diff --git a/includes/FormOptions.php b/includes/FormOptions.php index 725a512980..53c8d3bf7c 100644 --- a/includes/FormOptions.php +++ b/includes/FormOptions.php @@ -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 ); diff --git a/includes/OrderedStreamingForkController.php b/includes/OrderedStreamingForkController.php index 1436c1c960..ff29cb510d 100644 --- a/includes/OrderedStreamingForkController.php +++ b/includes/OrderedStreamingForkController.php @@ -56,7 +56,7 @@ class OrderedStreamingForkController extends ForkController { } /** - * {@inheritDoc} + * @inheritDoc */ public function start() { if ( $this->procsToStart > 0 ) { diff --git a/includes/Pingback.php b/includes/Pingback.php index bd1b2a25b4..c3393bcc1c 100644 --- a/includes/Pingback.php +++ b/includes/Pingback.php @@ -228,6 +228,7 @@ class Pingback { * * The schema for the data is located at: * + * @return bool */ public function sendPingback() { if ( !$this->acquireLock() ) { diff --git a/includes/Title.php b/includes/Title.php index 8cfeb882a0..3da6ab9552 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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 */ diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index d3ba0aa49c..c5cd89f14b 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -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 ) { diff --git a/includes/actions/MarkpatrolledAction.php b/includes/actions/MarkpatrolledAction.php index 611e6837f5..66bedb2bdf 100644 --- a/includes/actions/MarkpatrolledAction.php +++ b/includes/actions/MarkpatrolledAction.php @@ -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 ) { diff --git a/includes/api/ApiCSPReport.php b/includes/api/ApiCSPReport.php index a4631d6f34..0df0ca97d1 100644 --- a/includes/api/ApiCSPReport.php +++ b/includes/api/ApiCSPReport.php @@ -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; diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index 36247dd981..06eaa19ca4 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -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 ) { diff --git a/includes/api/ApiFormatFeedWrapper.php b/includes/api/ApiFormatFeedWrapper.php index d2bfd48d33..3ab5ab9e61 100644 --- a/includes/api/ApiFormatFeedWrapper.php +++ b/includes/api/ApiFormatFeedWrapper.php @@ -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 ); diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index e69300bb3b..1415640fc2 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -1870,7 +1870,7 @@ class ApiMain extends ApiBase { ]; } - /** @see ApiBase::getExamplesMessages() */ + /** @inheritDoc */ protected function getExamplesMessages() { return [ 'action=help' diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index fe16134c7b..051d346f1c 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -97,9 +97,7 @@ abstract class ApiQueryBase extends ApiBase { return $this->mQueryModule; } - /** - * @see ApiBase::getParent() - */ + /** @inheritDoc */ public function getParent() { return $this->getQuery(); } diff --git a/includes/api/ApiQueryGeneratorBase.php b/includes/api/ApiQueryGeneratorBase.php index f7b94c7c01..5acd75f7ef 100644 --- a/includes/api/ApiQueryGeneratorBase.php +++ b/includes/api/ApiQueryGeneratorBase.php @@ -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; diff --git a/includes/api/ApiUsageException.php b/includes/api/ApiUsageException.php index 17655ec1c3..47902a75b0 100644 --- a/includes/api/ApiUsageException.php +++ b/includes/api/ApiUsageException.php @@ -152,7 +152,7 @@ class ApiUsageException extends UsageException implements ILocalizedException { } /** - * @returns ApiMessage + * @return ApiMessage */ private function getApiMessage() { $errors = $this->status->getErrorsByType( 'error' ); diff --git a/includes/changes/ChangesListFilter.php b/includes/changes/ChangesListFilter.php index 0b34a5d969..2fc1006ed7 100644 --- a/includes/changes/ChangesListFilter.php +++ b/includes/changes/ChangesListFilter.php @@ -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(); diff --git a/includes/collation/IcuCollation.php b/includes/collation/IcuCollation.php index 54b04eead8..efda596335 100644 --- a/includes/collation/IcuCollation.php +++ b/includes/collation/IcuCollation.php @@ -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 ) { diff --git a/includes/compat/normal/UtfNormalUtil.php b/includes/compat/normal/UtfNormalUtil.php index 8791e4c371..d60c8e33ce 100644 --- a/includes/compat/normal/UtfNormalUtil.php +++ b/includes/compat/normal/UtfNormalUtil.php @@ -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 */ diff --git a/includes/config/GlobalVarConfig.php b/includes/config/GlobalVarConfig.php index 589f7d3548..6295371984 100644 --- a/includes/config/GlobalVarConfig.php +++ b/includes/config/GlobalVarConfig.php @@ -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 ); diff --git a/includes/config/HashConfig.php b/includes/config/HashConfig.php index 4d6c68ca8b..d020d20fe0 100644 --- a/includes/config/HashConfig.php +++ b/includes/config/HashConfig.php @@ -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; diff --git a/includes/config/MultiConfig.php b/includes/config/MultiConfig.php index cbb65aa609..2bbc84c99a 100644 --- a/includes/config/MultiConfig.php +++ b/includes/config/MultiConfig.php @@ -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 ) { diff --git a/includes/content/AbstractContent.php b/includes/content/AbstractContent.php index 1d472e0509..c12d28d9bc 100644 --- a/includes/content/AbstractContent.php +++ b/includes/content/AbstractContent.php @@ -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[] * diff --git a/includes/debug/logger/monolog/AvroFormatter.php b/includes/debug/logger/monolog/AvroFormatter.php index 2a50566912..a395e0d092 100644 --- a/includes/debug/logger/monolog/AvroFormatter.php +++ b/includes/debug/logger/monolog/AvroFormatter.php @@ -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 ) { diff --git a/includes/deferred/WANCacheReapUpdate.php b/includes/deferred/WANCacheReapUpdate.php index cbeb1fc77c..2e5298cc97 100644 --- a/includes/deferred/WANCacheReapUpdate.php +++ b/includes/deferred/WANCacheReapUpdate.php @@ -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 */ diff --git a/includes/externalstore/ExternalStoreHttp.php b/includes/externalstore/ExternalStoreHttp.php index c1f065122f..8e1e49fa60 100644 --- a/includes/externalstore/ExternalStoreHttp.php +++ b/includes/externalstore/ExternalStoreHttp.php @@ -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()." ); diff --git a/includes/externalstore/ExternalStoreMwstore.php b/includes/externalstore/ExternalStoreMwstore.php index b05843c4c8..5395f56274 100644 --- a/includes/externalstore/ExternalStoreMwstore.php +++ b/includes/externalstore/ExternalStoreMwstore.php @@ -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 ); diff --git a/includes/filerepo/FileBackendDBRepoWrapper.php b/includes/filerepo/FileBackendDBRepoWrapper.php index 0d5a15d2f0..21b7ac2fae 100644 --- a/includes/filerepo/FileBackendDBRepoWrapper.php +++ b/includes/filerepo/FileBackendDBRepoWrapper.php @@ -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'] ); diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index 55a19e8327..45a5c8247f 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -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 diff --git a/includes/filerepo/file/OldLocalFile.php b/includes/filerepo/file/OldLocalFile.php index b46e1e466f..ee172e1143 100644 --- a/includes/filerepo/file/OldLocalFile.php +++ b/includes/filerepo/file/OldLocalFile.php @@ -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(); diff --git a/includes/htmlform/HTMLFormField.php b/includes/htmlform/HTMLFormField.php index 3f1c590908..dfd18ba4c9 100644 --- a/includes/htmlform/HTMLFormField.php +++ b/includes/htmlform/HTMLFormField.php @@ -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 ) { diff --git a/includes/http/Http.php b/includes/http/Http.php index c10b312f31..6eff6c9cbd 100644 --- a/includes/http/Http.php +++ b/includes/http/Http.php @@ -168,6 +168,7 @@ class Http { /** * Get a configured MultiHttpClient * @param array $options + * @return MultiHttpClient */ public static function createMultiClient( $options = [] ) { global $wgHTTPConnectTimeout, $wgHTTPTimeout, $wgHTTPProxy; diff --git a/includes/http/PhpHttpRequest.php b/includes/http/PhpHttpRequest.php index 3f3803b41c..0c5d162345 100644 --- a/includes/http/PhpHttpRequest.php +++ b/includes/http/PhpHttpRequest.php @@ -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; diff --git a/includes/installer/InstallerSessionProvider.php b/includes/installer/InstallerSessionProvider.php index bfb1a69f30..568ef516ef 100644 --- a/includes/installer/InstallerSessionProvider.php +++ b/includes/installer/InstallerSessionProvider.php @@ -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; diff --git a/includes/installer/MssqlUpdater.php b/includes/installer/MssqlUpdater.php index b4de44dcfb..a2aa8c0f1a 100644 --- a/includes/installer/MssqlUpdater.php +++ b/includes/installer/MssqlUpdater.php @@ -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__ ) ) { diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index dc638998e5..c5dd4dcbc9 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -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, '/' ); diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 27300f3530..e0e54c845b 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -1005,6 +1005,7 @@ class WebInstaller extends Installer { * * @see getRadioSet * + * @param mixed[] $params * @return array */ public function getRadioElements( $params ) { diff --git a/includes/jobqueue/JobQueueSecondTestQueue.php b/includes/jobqueue/JobQueueSecondTestQueue.php index a1935dfa0d..4e3409af73 100644 --- a/includes/jobqueue/JobQueueSecondTestQueue.php +++ b/includes/jobqueue/JobQueueSecondTestQueue.php @@ -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() { diff --git a/includes/jobqueue/aggregator/JobQueueAggregator.php b/includes/jobqueue/aggregator/JobQueueAggregator.php index 7ce2c74fc2..f26beee4bd 100644 --- a/includes/jobqueue/aggregator/JobQueueAggregator.php +++ b/includes/jobqueue/aggregator/JobQueueAggregator.php @@ -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 ); diff --git a/includes/libs/IP.php b/includes/libs/IP.php index 3bfb531f5e..1c48f49d6b 100644 --- a/includes/libs/IP.php +++ b/includes/libs/IP.php @@ -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 diff --git a/includes/libs/MemoizedCallable.php b/includes/libs/MemoizedCallable.php index 90c7a644c5..14462f1d9f 100644 --- a/includes/libs/MemoizedCallable.php +++ b/includes/libs/MemoizedCallable.php @@ -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 ); diff --git a/includes/libs/Xhprof.php b/includes/libs/Xhprof.php index 016c9b1574..e58d98fcc3 100644 --- a/includes/libs/Xhprof.php +++ b/includes/libs/Xhprof.php @@ -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() ) { diff --git a/includes/libs/XhprofData.php b/includes/libs/XhprofData.php index 2383d2adc4..0be4ff6ad8 100644 --- a/includes/libs/XhprofData.php +++ b/includes/libs/XhprofData.php @@ -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 ) { diff --git a/includes/libs/mime/IEContentAnalyzer.php b/includes/libs/mime/IEContentAnalyzer.php index dfc7c4b431..e9fb11f7a8 100644 --- a/includes/libs/mime/IEContentAnalyzer.php +++ b/includes/libs/mime/IEContentAnalyzer.php @@ -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 = []; diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index 64fbea37f6..2c66d74860 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -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__, diff --git a/includes/libs/rdbms/database/DatabaseMssql.php b/includes/libs/rdbms/database/DatabaseMssql.php index 8f3cab8314..4ebc6233ed 100644 --- a/includes/libs/rdbms/database/DatabaseMssql.php +++ b/includes/libs/rdbms/database/DatabaseMssql.php @@ -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 = '`' ) { diff --git a/includes/libs/rdbms/database/DatabasePostgres.php b/includes/libs/rdbms/database/DatabasePostgres.php index ac59bd6171..672b3458ca 100644 --- a/includes/libs/rdbms/database/DatabasePostgres.php +++ b/includes/libs/rdbms/database/DatabasePostgres.php @@ -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 ) { diff --git a/includes/libs/stats/NullStatsdDataFactory.php b/includes/libs/stats/NullStatsdDataFactory.php index 73697514e5..d346f651f8 100644 --- a/includes/libs/stats/NullStatsdDataFactory.php +++ b/includes/libs/stats/NullStatsdDataFactory.php @@ -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 */ diff --git a/includes/libs/virtualrest/ParsoidVirtualRESTService.php b/includes/libs/virtualrest/ParsoidVirtualRESTService.php index a148a39707..64d1a82960 100644 --- a/includes/libs/virtualrest/ParsoidVirtualRESTService.php +++ b/includes/libs/virtualrest/ParsoidVirtualRESTService.php @@ -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'] ); diff --git a/includes/libs/virtualrest/RestbaseVirtualRESTService.php b/includes/libs/virtualrest/RestbaseVirtualRESTService.php index 90865ffcf1..192b4bd43d 100644 --- a/includes/libs/virtualrest/RestbaseVirtualRESTService.php +++ b/includes/libs/virtualrest/RestbaseVirtualRESTService.php @@ -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'] ); diff --git a/includes/libs/xmp/XMP.php b/includes/libs/xmp/XMP.php index e12766a2ad..c46acc691c 100644 --- a/includes/libs/xmp/XMP.php +++ b/includes/libs/xmp/XMP.php @@ -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' ); diff --git a/includes/media/WebP.php b/includes/media/WebP.php index 3e4731ae08..e23989dfa8 100644 --- a/includes/media/WebP.php +++ b/includes/media/WebP.php @@ -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 ) { diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index bf8a59710d..9491902329 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -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 diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 2dd4085e94..2981748098 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -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; diff --git a/includes/parser/Preprocessor.php b/includes/parser/Preprocessor.php index 24474d5795..627d112021 100644 --- a/includes/parser/Preprocessor.php +++ b/includes/parser/Preprocessor.php @@ -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(); diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php index 8e84cb2c82..332f8e9fa7 100644 --- a/includes/parser/Preprocessor_Hash.php +++ b/includes/parser/Preprocessor_Hash.php @@ -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 = []; diff --git a/includes/rcfeed/IRCColourfulRCFeedFormatter.php b/includes/rcfeed/IRCColourfulRCFeedFormatter.php index 10ba83fc19..531a3eb203 100644 --- a/includes/rcfeed/IRCColourfulRCFeedFormatter.php +++ b/includes/rcfeed/IRCColourfulRCFeedFormatter.php @@ -28,6 +28,10 @@ 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, diff --git a/includes/rcfeed/MachineReadableRCFeedFormatter.php b/includes/rcfeed/MachineReadableRCFeedFormatter.php index 20f88bd97c..a90d648eb3 100644 --- a/includes/rcfeed/MachineReadableRCFeedFormatter.php +++ b/includes/rcfeed/MachineReadableRCFeedFormatter.php @@ -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; diff --git a/includes/rcfeed/RedisPubSubFeedEngine.php b/includes/rcfeed/RedisPubSubFeedEngine.php index f0fcd7da74..3abc9c1d4b 100644 --- a/includes/rcfeed/RedisPubSubFeedEngine.php +++ b/includes/rcfeed/RedisPubSubFeedEngine.php @@ -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'] ); diff --git a/includes/rcfeed/UDPRCFeedEngine.php b/includes/rcfeed/UDPRCFeedEngine.php index 61ced5f440..f76d771ef4 100644 --- a/includes/rcfeed/UDPRCFeedEngine.php +++ b/includes/rcfeed/UDPRCFeedEngine.php @@ -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'] ); diff --git a/includes/resourceloader/ResourceLoaderImageModule.php b/includes/resourceloader/ResourceLoaderImageModule.php index d26c96181c..cbcf5a0d62 100644 --- a/includes/resourceloader/ResourceLoaderImageModule.php +++ b/includes/resourceloader/ResourceLoaderImageModule.php @@ -427,6 +427,8 @@ class ResourceLoaderImageModule extends ResourceLoaderModule { /** * Helper method for getDefinitionSummary. + * @param ResourceLoaderContext $context + * @return array */ protected function getFileHashes( ResourceLoaderContext $context ) { $this->loadFromDefinition(); diff --git a/includes/resourceloader/ResourceLoaderSiteModule.php b/includes/resourceloader/ResourceLoaderSiteModule.php index 08641b0c30..236112ea2f 100644 --- a/includes/resourceloader/ResourceLoaderSiteModule.php +++ b/includes/resourceloader/ResourceLoaderSiteModule.php @@ -43,6 +43,7 @@ class ResourceLoaderSiteModule extends ResourceLoaderWikiModule { } /** + * @param ResourceLoaderContext|null $context * @return array */ public function getDependencies( ResourceLoaderContext $context = null ) { diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index d535ffcd3a..8b9feeb8f0 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -297,6 +297,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { } /** + * @param ResourceLoaderContext $context * @return array */ public function getPreloadLinks( ResourceLoaderContext $context ) { diff --git a/includes/resourceloader/ResourceLoaderUploadDialogModule.php b/includes/resourceloader/ResourceLoaderUploadDialogModule.php index 9377ed6e26..1a390cf1d6 100644 --- a/includes/resourceloader/ResourceLoaderUploadDialogModule.php +++ b/includes/resourceloader/ResourceLoaderUploadDialogModule.php @@ -30,6 +30,7 @@ class ResourceLoaderUploadDialogModule extends ResourceLoaderModule { protected $targets = [ 'desktop', 'mobile' ]; /** + * @param ResourceLoaderContext $context * @return string JavaScript code */ public function getScript( ResourceLoaderContext $context ) { diff --git a/includes/resourceloader/ResourceLoaderUserModule.php b/includes/resourceloader/ResourceLoaderUserModule.php index 8f58040a8c..8e213819f6 100644 --- a/includes/resourceloader/ResourceLoaderUserModule.php +++ b/includes/resourceloader/ResourceLoaderUserModule.php @@ -78,6 +78,7 @@ class ResourceLoaderUserModule extends ResourceLoaderWikiModule { } /** + * @param ResourceLoaderContext|null $context * @return array */ public function getDependencies( ResourceLoaderContext $context = null ) { diff --git a/includes/search/ParserOutputSearchDataExtractor.php b/includes/search/ParserOutputSearchDataExtractor.php index df653f1240..4b60a0c533 100644 --- a/includes/search/ParserOutputSearchDataExtractor.php +++ b/includes/search/ParserOutputSearchDataExtractor.php @@ -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 ) { diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index 7c2f0f25ca..3c8fe608b4 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -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' ]; diff --git a/includes/search/SearchResultSet.php b/includes/search/SearchResultSet.php index 89d2299b1b..f25c7283eb 100644 --- a/includes/search/SearchResultSet.php +++ b/includes/search/SearchResultSet.php @@ -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 ) { diff --git a/includes/search/SearchSuggestionSet.php b/includes/search/SearchSuggestionSet.php index 6d54dada4e..aced5e18af 100644 --- a/includes/search/SearchSuggestionSet.php +++ b/includes/search/SearchSuggestionSet.php @@ -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 ); diff --git a/includes/session/BotPasswordSessionProvider.php b/includes/session/BotPasswordSessionProvider.php index 5831b098fa..a588aeea53 100644 --- a/includes/session/BotPasswordSessionProvider.php +++ b/includes/session/BotPasswordSessionProvider.php @@ -167,6 +167,7 @@ class BotPasswordSessionProvider extends ImmutableSessionProviderWithCookie { /** * @codeCoverageIgnore + * @inheritDoc */ public function preventSessionsForUser( $username ) { BotPassword::removeAllPasswordsForUser( $username ); diff --git a/includes/session/Session.php b/includes/session/Session.php index 12f16b662e..23d9ab3838 100644 --- a/includes/session/Session.php +++ b/includes/session/Session.php @@ -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(); diff --git a/includes/site/HashSiteStore.php b/includes/site/HashSiteStore.php index 2c7965c902..6d98e72530 100644 --- a/includes/site/HashSiteStore.php +++ b/includes/site/HashSiteStore.php @@ -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 = []; diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php index 180a6df9c4..4fcc8657b0 100644 --- a/includes/skins/SkinTemplate.php +++ b/includes/skins/SkinTemplate.php @@ -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 ); diff --git a/includes/specialpage/ChangesListSpecialPage.php b/includes/specialpage/ChangesListSpecialPage.php index 04d03f5200..d943d036b6 100644 --- a/includes/specialpage/ChangesListSpecialPage.php +++ b/includes/specialpage/ChangesListSpecialPage.php @@ -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; diff --git a/includes/specialpage/RedirectSpecialPage.php b/includes/specialpage/RedirectSpecialPage.php index d3e22a0f62..8d39c996af 100644 --- a/includes/specialpage/RedirectSpecialPage.php +++ b/includes/specialpage/RedirectSpecialPage.php @@ -35,6 +35,7 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage { /** * @param string|null $subpage + * @return Title|bool */ public function execute( $subpage ) { $redirect = $this->getRedirect( $subpage ); diff --git a/includes/specialpage/WantedQueryPage.php b/includes/specialpage/WantedQueryPage.php index 5318895f04..8b60387efa 100644 --- a/includes/specialpage/WantedQueryPage.php +++ b/includes/specialpage/WantedQueryPage.php @@ -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 ) { diff --git a/includes/specials/SpecialAllPages.php b/includes/specials/SpecialAllPages.php index 4d84e316ce..f9c917d35e 100644 --- a/includes/specials/SpecialAllPages.php +++ b/includes/specials/SpecialAllPages.php @@ -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 == '' ) { diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index 252dc68c3b..cd3c0289c8 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -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; diff --git a/includes/specials/SpecialLinkSearch.php b/includes/specials/SpecialLinkSearch.php index dae60744dc..cda0854d4b 100644 --- a/includes/specials/SpecialLinkSearch.php +++ b/includes/specials/SpecialLinkSearch.php @@ -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 ); diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index 61590d7567..edfaa7c2f8 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -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 ) { diff --git a/includes/specials/SpecialUnlinkAccounts.php b/includes/specials/SpecialUnlinkAccounts.php index 86bc7ed30f..b159fff1bd 100644 --- a/includes/specials/SpecialUnlinkAccounts.php +++ b/includes/specials/SpecialUnlinkAccounts.php @@ -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'; diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index d0eb8e3742..b98fad1997 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -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(); diff --git a/includes/specials/SpecialWantedfiles.php b/includes/specials/SpecialWantedfiles.php index 6d481f8fdc..2ebbc2d86c 100644 --- a/includes/specials/SpecialWantedfiles.php +++ b/includes/specials/SpecialWantedfiles.php @@ -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 ) { diff --git a/includes/tidy/Balancer.php b/includes/tidy/Balancer.php index 947a572480..fbe92702df 100644 --- a/includes/tidy/Balancer.php +++ b/includes/tidy/Balancer.php @@ -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 <a> "in body mode". + * @param string $tag + * @return null|Node */ public function findElementByTag( $tag ) { $elt = $this->tail; diff --git a/includes/tidy/TidyDriverBase.php b/includes/tidy/TidyDriverBase.php index 6e01894008..f88b673479 100644 --- a/includes/tidy/TidyDriverBase.php +++ b/includes/tidy/TidyDriverBase.php @@ -14,6 +14,7 @@ abstract class TidyDriverBase { /** * Return true if validate() can be used + * @return bool */ public function supportsValidate() { return false; diff --git a/includes/utils/AutoloadGenerator.php b/includes/utils/AutoloadGenerator.php index 19f5100a4c..4f639c13fb 100644 --- a/includes/utils/AutoloadGenerator.php +++ b/includes/utils/AutoloadGenerator.php @@ -321,7 +321,7 @@ class ClassCollector { protected $alias; /** - * @var string $code PHP code (including getSiteStore(); diff --git a/maintenance/findDeprecated.php b/maintenance/findDeprecated.php index 94b7fb4429..6128d2386d 100644 --- a/maintenance/findDeprecated.php +++ b/maintenance/findDeprecated.php @@ -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 ) { diff --git a/maintenance/generateSitemap.php b/maintenance/generateSitemap.php index d273a6a802..26a9c39935 100644 --- a/maintenance/generateSitemap.php +++ b/maintenance/generateSitemap.php @@ -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 ) { diff --git a/maintenance/migrateComments.php b/maintenance/migrateComments.php index 431380647a..9d4e2615c0 100644 --- a/maintenance/migrateComments.php +++ b/maintenance/migrateComments.php @@ -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. diff --git a/maintenance/userOptions.inc b/maintenance/userOptions.inc index 01cf3c3eb1..8ac7f919ee 100644 --- a/maintenance/userOptions.inc +++ b/maintenance/userOptions.inc @@ -106,6 +106,7 @@ class UserOptions { /** * Dumb stuff to run a mode. + * @return bool */ public function run() { if ( !$this->mReady ) { diff --git a/tests/integration/includes/http/MWHttpRequestTestCase.php b/tests/integration/includes/http/MWHttpRequestTestCase.php index 545769681d..81473df227 100644 --- a/tests/integration/includes/http/MWHttpRequestTestCase.php +++ b/tests/integration/includes/http/MWHttpRequestTestCase.php @@ -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 ) { diff --git a/tests/parser/DbTestPreviewer.php b/tests/parser/DbTestPreviewer.php index 784c29cf4b..33aee7d304 100644 --- a/tests/parser/DbTestPreviewer.php +++ b/tests/parser/DbTestPreviewer.php @@ -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; diff --git a/tests/parser/ParserTestPrinter.php b/tests/parser/ParserTestPrinter.php index ac9f150945..94d226c1d5 100644 --- a/tests/parser/ParserTestPrinter.php +++ b/tests/parser/ParserTestPrinter.php @@ -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 ) { diff --git a/tests/parser/ParserTestResultNormalizer.php b/tests/parser/ParserTestResultNormalizer.php index 37ed85f75d..61aa0d795f 100644 --- a/tests/parser/ParserTestResultNormalizer.php +++ b/tests/parser/ParserTestResultNormalizer.php @@ -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 ), diff --git a/tests/parser/ParserTestRunner.php b/tests/parser/ParserTestRunner.php index 46c551b68f..298a3c10c5 100644 --- a/tests/parser/ParserTestRunner.php +++ b/tests/parser/ParserTestRunner.php @@ -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 ) { diff --git a/tests/parser/PhpunitTestRecorder.php b/tests/parser/PhpunitTestRecorder.php index 238d018eee..2f82ca7267 100644 --- a/tests/parser/PhpunitTestRecorder.php +++ b/tests/parser/PhpunitTestRecorder.php @@ -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" ); diff --git a/tests/parser/TidySupport.php b/tests/parser/TidySupport.php index 39c9ca5272..6aed02f304 100644 --- a/tests/parser/TidySupport.php +++ b/tests/parser/TidySupport.php @@ -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, diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 91aaff5236..f04eec73b4 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -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 ) { diff --git a/tests/phpunit/ResourceLoaderTestCase.php b/tests/phpunit/ResourceLoaderTestCase.php index f75cc2294c..1024ecd0a6 100644 --- a/tests/phpunit/ResourceLoaderTestCase.php +++ b/tests/phpunit/ResourceLoaderTestCase.php @@ -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 ) { diff --git a/tests/phpunit/includes/db/DatabaseTestHelper.php b/tests/phpunit/includes/db/DatabaseTestHelper.php index 9ed8f15630..d19d998146 100644 --- a/tests/phpunit/includes/db/DatabaseTestHelper.php +++ b/tests/phpunit/includes/db/DatabaseTestHelper.php @@ -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 ); diff --git a/tests/phpunit/includes/specials/SpecialPageExecutor.php b/tests/phpunit/includes/specials/SpecialPageExecutor.php index 2f7b7678ca..e7cfca7f01 100644 --- a/tests/phpunit/includes/specials/SpecialPageExecutor.php +++ b/tests/phpunit/includes/specials/SpecialPageExecutor.php @@ -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( diff --git a/tests/phpunit/includes/specials/SpecialPageTestBase.php b/tests/phpunit/includes/specials/SpecialPageTestBase.php index 2f091d5d06..930bbe4de7 100644 --- a/tests/phpunit/includes/specials/SpecialPageTestBase.php +++ b/tests/phpunit/includes/specials/SpecialPageTestBase.php @@ -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( diff --git a/tests/phpunit/mocks/content/DummyContentHandlerForTesting.php b/tests/phpunit/mocks/content/DummyContentHandlerForTesting.php index d712254c22..6b9b782397 100644 --- a/tests/phpunit/mocks/content/DummyContentHandlerForTesting.php +++ b/tests/phpunit/mocks/content/DummyContentHandlerForTesting.php @@ -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( '' ); diff --git a/tests/phpunit/mocks/content/DummyNonTextContentHandler.php b/tests/phpunit/mocks/content/DummyNonTextContentHandler.php index 098181debb..9d91d4a1a2 100644 --- a/tests/phpunit/mocks/content/DummyNonTextContentHandler.php +++ b/tests/phpunit/mocks/content/DummyNonTextContentHandler.php @@ -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( '' ); diff --git a/tests/phpunit/mocks/filebackend/MockFSFile.php b/tests/phpunit/mocks/filebackend/MockFSFile.php index 047c03ad1f..ef1caa5d12 100644 --- a/tests/phpunit/mocks/filebackend/MockFSFile.php +++ b/tests/phpunit/mocks/filebackend/MockFSFile.php @@ -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;