Add missing @return and @param to function docs and fixed some @param
Change-Id: I810727961057cfdcc274428b239af5975c57468d
107 files changed:
/**
* Load up our object with user supplied data
/**
* Load up our object with user supplied data
+ * @param Config $config
*/
function __construct( Config $config ) {
$this->config = $config;
*/
function __construct( Config $config ) {
$this->config = $config;
* which in turn gives User::getName().
*
* @param string|int|User|null $target
* 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
*/
public static function parseTarget( $target ) {
# We may have been through this before
* 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.
* 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() {
* @todo FIXME: This should be an integral part of the Block member variables
*/
public function getTargetAndType() {
/**
* @see validateBounds()
/**
* @see validateBounds()
+ * @param string $name
+ * @param int $min
+ * @param int $max
*/
public function validateIntBounds( $name, $min, $max ) {
$this->validateBounds( $name, $min, $max );
*/
public function validateIntBounds( $name, $min, $max ) {
$this->validateBounds( $name, $min, $max );
*/
public function start() {
if ( $this->procsToStart > 0 ) {
*/
public function start() {
if ( $this->procsToStart > 0 ) {
*
* The schema for the data is located at:
* <https://meta.wikimedia.org/wiki/Schema:MediaWikiPingback>
*
* The schema for the data is located at:
* <https://meta.wikimedia.org/wiki/Schema:MediaWikiPingback>
*/
public function sendPingback() {
if ( !$this->acquireLock() ) {
*/
public function sendPingback() {
if ( !$this->acquireLock() ) {
* @see self::getLocalURL for the arguments.
* @param array|string $query
* @param string $proto Protocol type to use in URL
* @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;
*/
public function getFullUrlForRedirect( $query = '', $proto = PROTO_CURRENT ) {
$target = $this;
* NOTE: Unlike getInternalURL(), the canonical URL includes the fragment
*
* @see self::getLocalURL for the arguments.
* 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
*/
* @return string The URL
* @since 1.18
*/
* Creates a header that can be added to the output.
*
* @param string $header The header text.
* 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 ) {
* @return string The HTML.
*/
protected function makeHeader( $header, $canonicalId ) {
* @return bool|array True for success, false for didn't-try, array of errors on failure
*/
public function onSubmit( $data ) {
* @return bool|array True for success, false for didn't-try, array of errors on failure
*/
public function onSubmit( $data ) {
/**
* Mark as internal. This isn't meant to be used by normal api users
/**
* Mark as internal. This isn't meant to be used by normal api users
*/
public function isInternal() {
return true;
*/
public function isInternal() {
return true;
/**
* Even if you don't have read rights, we still want your report.
/**
* Even if you don't have read rights, we still want your report.
*/
public function isReadMode() {
return false;
*/
public function isReadMode() {
return false;
* Doesn't touch db, so max lag should be rather irrelavent.
*
* Also, this makes sure that reports aren't lost during lag events.
* Doesn't touch db, so max lag should be rather irrelavent.
*
* Also, this makes sure that reports aren't lost during lag events.
*/
public function shouldCheckMaxLag() {
return false;
*/
public function shouldCheckMaxLag() {
return false;
/**
* Overridden to honor $this->forceDefaultParams(), if applicable
/**
* Overridden to honor $this->forceDefaultParams(), if applicable
* @since 1.26
*/
protected function getParameterFromSettings( $paramName, $paramSettings, $parseLimit ) {
* @since 1.26
*/
protected function getParameterFromSettings( $paramName, $paramSettings, $parseLimit ) {
* 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
* 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
*/
public function initPrinter( $unused = false ) {
parent::initPrinter( $unused );
*/
public function initPrinter( $unused = false ) {
parent::initPrinter( $unused );
- /** @see ApiBase::getExamplesMessages() */
protected function getExamplesMessages() {
return [
'action=help'
protected function getExamplesMessages() {
return [
'action=help'
return $this->mQueryModule;
}
return $this->mQueryModule;
}
- /**
- * @see ApiBase::getParent()
- */
public function getParent() {
return $this->getQuery();
}
public function getParent() {
return $this->getQuery();
}
- /**
- * @see ApiBase::getHelpFlags()
- *
- * Corresponding messages: api-help-flag-generator
- */
protected function getHelpFlags() {
protected function getHelpFlags() {
+ // Corresponding messages: api-help-flag-generator
$flags = parent::getHelpFlags();
$flags[] = 'generator';
return $flags;
$flags = parent::getHelpFlags();
$flags[] = 'generator';
return $flags;
*/
private function getApiMessage() {
$errors = $this->status->getErrorsByType( 'error' );
*/
private function getApiMessage() {
$errors = $this->status->getErrorsByType( 'error' );
* structured UI.
*
* This can either be the exact filter, or a new filter that replaces it.
* structured UI.
*
* This can either be the exact filter, or a new filter that replaces it.
*/
public function isFeatureAvailableOnStructuredUi() {
return $this->displaysOnStructuredUi();
*/
public function isFeatureAvailableOnStructuredUi() {
return $this->displaysOnStructuredUi();
+ * @param string $index
+ * @return string
* @since 1.16.3
*/
public function getLetterByIndex( $index ) {
* @since 1.16.3
*/
public function getLetterByIndex( $index ) {
+ * @param string $index
+ * @return string
* @since 1.16.3
*/
public function getSortKeyByLetterIndex( $index ) {
* @since 1.16.3
*/
public function getSortKeyByLetterIndex( $index ) {
+ * @param string $index
+ * @return string
* @since 1.16.3
*/
public function getFirstLetterCount() {
* @since 1.16.3
*/
public function getFirstLetterCount() {
/**
* Test if a code point is a CJK (Chinese, Japanese, Korean) character
/**
* 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 ) {
* @since 1.16.3
*/
public static function isCjk( $codepoint ) {
* Escape a string for inclusion in a PHP single-quoted string literal.
*
* @param string $string string to be escaped.
* 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
*/
* @public
* @deprecated since 1.25, use UtfNormal\Utils directly
*/
*/
public function get( $name ) {
if ( !$this->has( $name ) ) {
*/
public function get( $name ) {
if ( !$this->has( $name ) ) {
*/
public function has( $name ) {
return $this->hasWithPrefix( $this->prefix, $name );
*/
public function has( $name ) {
return $this->hasWithPrefix( $this->prefix, $name );
*/
public function get( $name ) {
if ( !$this->has( $name ) ) {
*/
public function get( $name ) {
if ( !$this->has( $name ) ) {
+ * @inheritDoc
+ * @since 1.24
*/
public function has( $name ) {
return array_key_exists( $name, $this->settings );
*/
public function has( $name ) {
return array_key_exists( $name, $this->settings );
/**
* @see MutableConfig::set
/**
* @see MutableConfig::set
+ * @param string $name
+ * @param mixed $value
*/
public function set( $name, $value ) {
$this->settings[$name] = $value;
*/
public function set( $name, $value ) {
$this->settings[$name] = $value;
*/
public function get( $name ) {
foreach ( $this->configs as $config ) {
*/
public function get( $name ) {
foreach ( $this->configs as $config ) {
*/
public function has( $name ) {
foreach ( $this->configs as $config ) {
*/
public function has( $name ) {
foreach ( $this->configs as $config ) {
* @since 1.21
*
* @see Content::getModel
* @since 1.21
*
* @see Content::getModel
*/
public function getModel() {
return $this->model_id;
*/
public function getModel() {
return $this->model_id;
* @since 1.21
*
* @see Content::getContentHandler
* @since 1.21
*
* @see Content::getContentHandler
+ * @return ContentHandler
*/
public function getContentHandler() {
return ContentHandler::getForContent( $this );
*/
public function getContentHandler() {
return ContentHandler::getForContent( $this );
* @since 1.21
*
* @see Content::getDefaultFormat
* @since 1.21
*
* @see Content::getDefaultFormat
*/
public function getDefaultFormat() {
return $this->getContentHandler()->getDefaultFormat();
*/
public function getDefaultFormat() {
return $this->getContentHandler()->getDefaultFormat();
* @since 1.21
*
* @see Content::getSupportedFormats
* @since 1.21
*
* @see Content::getSupportedFormats
*/
public function getSupportedFormats() {
return $this->getContentHandler()->getSupportedFormats();
*/
public function getSupportedFormats() {
return $this->getContentHandler()->getSupportedFormats();
+ * @param string|int $sectionId
* @return null
*
* @see Content::getSection
* @return null
*
* @see Content::getSection
+ * @param string|int|null|bool $sectionId
+ * @param Content $with
+ * @param string $sectionTitle
* @return null
*
* @see Content::replaceSection
* @return null
*
* @see Content::replaceSection
+ * @param Title $title
+ * @param User $user
+ * @param ParserOptions $popts
* @return Content $this
*
* @see Content::preSaveTransform
* @return Content $this
*
* @see Content::preSaveTransform
+ * @param string $header
* @return Content $this
*
* @see Content::addSectionHeader
* @return Content $this
*
* @see Content::addSectionHeader
+ * @param Title $title
+ * @param ParserOptions $popts
+ * @param array $params
* @return Content $this
*
* @see Content::preloadTransform
* @return Content $this
*
* @see Content::preloadTransform
+ * @param WikiPage $page
+ * @param int $flags
+ * @param int $parentRevId
+ * @param User $user
* @return Status
*
* @see Content::prepareSave
* @return Status
*
* @see Content::prepareSave
* @since 1.21
*
* @param WikiPage $page
* @since 1.21
*
* @param WikiPage $page
- * @param ParserOutput $parserOutput
+ * @param ParserOutput|null $parserOutput
*
* @return LinksDeletionUpdate[]
*
*
* @return LinksDeletionUpdate[]
*
- * @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.
*/
* Each schema can be either the JSON string or decoded into PHP
* arrays.
*/
/**
* Get the writer for the named channel
*
/**
* 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 ) {
* @return \AvroSchema|null
*/
protected function getSchema( $channel ) {
/**
* Get the writer for the named channel
*
/**
* 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 ) {
* @return int|null
*/
public function getSchemaRevisionId( $channel ) {
* @see WANObjectCacheRepear
* @param WANObjectCache $cache
* @param TitleValue $t
* @see WANObjectCacheRepear
* @param WANObjectCache $cache
* @param TitleValue $t
*/
public function getEventAffectedKeys( WANObjectCache $cache, TitleValue $t ) {
/** @var WikiPage[]|LocalFile[]|User[] $entities */
*/
public function getEventAffectedKeys( WANObjectCache $cache, TitleValue $t ) {
/** @var WikiPage[]|LocalFile[]|User[] $entities */
class ExternalStoreHttp extends ExternalStoreMedium {
/**
* @see ExternalStoreMedium::fetchFromURL()
class ExternalStoreHttp extends ExternalStoreMedium {
/**
* @see ExternalStoreMedium::fetchFromURL()
+ * @param string $url
+ * @return string|bool
+ * @throws MWException
*/
public function fetchFromURL( $url ) {
return Http::get( $url, [], __METHOD__ );
*/
public function fetchFromURL( $url ) {
return Http::get( $url, [], __METHOD__ );
/**
* @see ExternalStoreMedium::store()
/**
* @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()." );
*/
public function store( $cluster, $data ) {
throw new MWException( "ExternalStoreHttp is read-only and does not support store()." );
* The URL returned is of the form of the form mwstore://backend/container/wiki/id
*
* @see ExternalStoreMedium::fetchFromURL()
* 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 );
*/
public function fetchFromURL( $url ) {
$be = FileBackendGroup::singleton()->backendFromPath( $url );
/**
* @see ExternalStoreMedium::store()
/**
* @see ExternalStoreMedium::store()
+ * @param string $backend
+ * @param string $data
+ * @return string|bool
+ * @throws MWException
*/
public function store( $backend, $data ) {
$be = FileBackendGroup::singleton()->get( $backend );
*/
public function store( $backend, $data ) {
$be = FileBackendGroup::singleton()->get( $backend );
*
* @param string $function
* @param array $params
*
* @param string $function
* @param array $params
*/
protected function translateSrcParams( $function, array $params ) {
$latest = !empty( $params['latest'] );
*/
protected function translateSrcParams( $function, array $params ) {
$latest = !empty( $params['latest'] );
* @param string $name
* @param int $width
* @param int $height
* @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
* @param string $otherParams
*
* @return bool
*
* This is the case for a couple files on Wikimedia servers where
* the old version is "lost".
*
* This is the case for a couple files on Wikimedia servers where
* the old version is "lost".
*/
public function exists() {
$archiveName = $this->getArchiveName();
*/
public function exists() {
$archiveName = $this->getArchiveName();
/**
* Get a FieldLayout (or subclass thereof) to wrap this field in when using OOUI output.
/**
* 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 ) {
* @return OOUI\FieldLayout|OOUI\ActionFieldLayout
*/
protected function getFieldLayoutOOUI( $inputField, $config ) {
/**
* Get a configured MultiHttpClient
* @param array $options
/**
* Get a configured MultiHttpClient
* @param array $options
+ * @return MultiHttpClient
*/
public static function createMultiClient( $options = [] ) {
global $wgHTTPConnectTimeout, $wgHTTPTimeout, $wgHTTPProxy;
*/
public static function createMultiClient( $options = [] ) {
global $wgHTTPConnectTimeout, $wgHTTPTimeout, $wgHTTPProxy;
* so normal methods of handling errors programmatically
* like get_last_error() don't work.
* @internal
* 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;
*/
public function errorHandler( $errno, $errstr ) {
$n = count( $this->fopenErrors ) + 1;
class InstallerSessionProvider extends SessionProvider {
/**
* Pretend there is a session, to avoid MWCryptRand overhead
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, [
*/
public function provideSessionInfo( WebRequest $request ) {
return new SessionInfo( 1, [
/**
* Yes we will treat your data with great care!
/**
* Yes we will treat your data with great care!
*/
public function persistsSessionId() {
return true;
*/
public function persistsSessionId() {
return true;
/**
* Sure, you can be whoever you want, as long as you have ID 0
/**
* Sure, you can be whoever you want, as long as you have ID 0
*/
public function canChangeUser() {
return true;
*/
public function canChangeUser() {
return true;
* @param string $updatekey
* @param string $patch
* @param bool $fullpath
* @param string $updatekey
* @param string $patch
* @param bool $fullpath
*/
protected function updateSchema( $table, $updatekey, $patch, $fullpath = false ) {
if ( !$this->db->tableExists( $table, __METHOD__ ) ) {
*/
protected function updateSchema( $table, $updatekey, $patch, $fullpath = false ) {
if ( !$this->db->tableExists( $table, __METHOD__ ) ) {
+ * @param string $escapeChar
* @return string
*/
protected function escapeLikeInternal( $s, $escapeChar = '`' ) {
* @return string
*/
protected function escapeLikeInternal( $s, $escapeChar = '`' ) {
/**
* Convert a wildcard (as used in LIKE) to a regex
* Slashes are escaped, slash terminators included
/**
* 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, '/' );
*/
protected function likeToRegex( $wildcard ) {
$r = preg_quote( $wildcard, '/' );
+ * @param mixed[] $params
* @return array
*/
public function getRadioElements( $params ) {
* @return array
*/
public function getRadioElements( $params ) {
/**
* @see JobQueue::ack()
* @param Job $job
/**
* @see JobQueue::ack()
* @param Job $job
*/
protected function doAck( Job $job ) {
return $this->mainQueue->doAck( $job );
*/
protected function doAck( Job $job ) {
return $this->mainQueue->doAck( $job );
/**
* @see JobQueue::delete()
/**
* @see JobQueue::delete()
* @throws MWException
*/
protected function doDelete() {
* @throws MWException
*/
protected function doDelete() {
/**
* @see JobQueueAggregator::notifyQueueEmpty()
/**
* @see JobQueueAggregator::notifyQueueEmpty()
+ * @param string $wiki
+ * @param string $type
+ * @return bool
*/
abstract protected function doNotifyQueueEmpty( $wiki, $type );
*/
abstract protected function doNotifyQueueEmpty( $wiki, $type );
/**
* @see JobQueueAggregator::notifyQueueNonEmpty()
/**
* @see JobQueueAggregator::notifyQueueNonEmpty()
+ * @param string $wiki
+ * @param string $type
+ * @return bool
*/
abstract protected function doNotifyQueueNonEmpty( $wiki, $type );
*/
abstract protected function doNotifyQueueNonEmpty( $wiki, $type );
* 2001:0db8:85a3::7344 - 2001:0db8:85a3::7344 Explicit range
* 2001:0db8:85a3::7344 Single IP
* @param string $range IP range
* 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
*/
public static function parseRange( $range ) {
// CIDR notation
*
* @param string $key
* @param bool &$success
*
* @param string $key
* @param bool &$success
*/
protected function fetchResult( $key, &$success ) {
$success = false;
*/
protected function fetchResult( $key, &$success ) {
$success = false;
* @param callable $callable
* @param array $args
* @param int $ttl
* @param callable $callable
* @param array $args
* @param int $ttl
*/
public static function call( $callable, array $args = [], $ttl = 3600 ) {
$instance = new self( $callable, $ttl );
*/
public static function call( $callable, array $args = [], $ttl = 3600 ) {
$instance = new self( $callable, $ttl );
/**
* Start xhprof profiler
/**
* Start xhprof profiler
*/
public static function isEnabled() {
return self::$enabled;
*/
public static function isEnabled() {
return self::$enabled;
/**
* Start xhprof profiler
/**
* Start xhprof profiler
+ * @param int $flags
+ * @param array $options
+ * @throws Exception
*/
public static function enable( $flags = 0, $options = [] ) {
if ( self::isEnabled() ) {
*/
public static function enable( $flags = 0, $options = [] ) {
if ( self::isEnabled() ) {
* The resulting array is left padded with nulls, so a key
* with no parent (eg 'main()') will return [null, 'function'].
*
* The resulting array is left padded with nulls, so a key
* with no parent (eg 'main()') will return [null, 'function'].
*
* @return array
*/
public static function splitKey( $key ) {
* @return array
*/
public static function splitKey( $key ) {
* @param string $chunk the first 256 bytes of the file
* @param string $proposed the MIME type proposed by the server
*
* @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 );
*/
public function getRealMimesFromData( $fileName, $chunk, $proposed ) {
$types = $this->getMimesFromData( $fileName, $chunk, $proposed );
* @param string $chunk the first 256 bytes of the file
* @param string $proposed the MIME type proposed by the server
*
* @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 = [];
*/
public function getMimesFromData( $fileName, $chunk, $proposed ) {
$types = [];
+ * @param string $escapeChar
* @return string
*/
protected function escapeLikeInternal( $s, $escapeChar = '`' ) {
* @return string
*/
protected function escapeLikeInternal( $s, $escapeChar = '`' ) {
* we don't want to select everything into memory
*
* @see IDatabase::insertSelect()
* 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__,
*/
protected function nativeInsertSelect( $destTable, $srcTable, $varMap, $conds,
$fname = __METHOD__,
* MS SQL supports more pattern operators than other databases (ex: [,],^)
*
* @param string $s
* MS SQL supports more pattern operators than other databases (ex: [,],^)
*
* @param string $s
+ * @param string $escapeChar
* @return string
*/
protected function escapeLikeInternal( $s, $escapeChar = '`' ) {
* @return string
*/
protected function escapeLikeInternal( $s, $escapeChar = '`' ) {
- * @var string $table
- * @var string $field
+ * @param string $table
+ * @param string $field
* @return PostgresField|null
*/
public function fieldInfo( $table, $field ) {
* @return PostgresField|null
*/
public function fieldInfo( $table, $field ) {
* and logged in users by sending the current userId of a user
* with each request with a key of "uniques" (or similar).
*
* 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.
* 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.
* 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'] );
*/
public function onParsoid1Request( array $req, Closure $idGeneratorFunc ) {
$parts = explode( '/', $req['url'] );
/**
* Remaps Parsoid v1/v3 requests to RESTBase v1 requests.
/**
* 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 = [];
*/
public function onParsoidRequests( array $reqs, Closure $idGeneratorFunc ) {
$result = [];
* NOTE: the POST APIs aren't "real" Parsoid v1 APIs, they are just what
* Visual Editor "pretends" the V1 API is like. (See
* ParsoidVirtualRESTService.)
* 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'] );
*/
public function onParsoid1Request( array $req, Closure $idGeneratorFunc ) {
$parts = explode( '/', $req['url'] );
* * body: array( 'wikitext' => ... ) or array( 'wikitext' => ..., 'body_only' => true/false )
* * $title is optional
* * $revision is optional
* * 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'] );
*/
public function onParsoid3Request( array $req, Closure $idGeneratorFunc ) {
$parts = explode( '/', $req['url'] );
/**
* Primary job is to initialize the XMLParser
/**
* Primary job is to initialize the XMLParser
+ * @param LoggerInterface|null $logger
*/
function __construct( LoggerInterface $logger = null ) {
if ( !function_exists( 'xml_parser_create_ns' ) ) {
*/
function __construct( LoggerInterface $logger = null ) {
if ( !function_exists( 'xml_parser_create_ns' ) ) {
/**
* Check if this instance supports using this class
/**
* Check if this instance supports using this class
*/
public static function isSupported() {
return function_exists( 'xml_parser_create_ns' ) && class_exists( 'XMLReader' );
*/
public static function isSupported() {
return function_exists( 'xml_parser_create_ns' ) && class_exists( 'XMLReader' );
/**
* Must use "im" for XCF
*
/**
* Must use "im" for XCF
*
+ * @param string $dstPath
+ * @param bool $checkDstPath
* @return string
*/
protected function getScalerType( $dstPath, $checkDstPath = true ) {
* @return string
*/
protected function getScalerType( $dstPath, $checkDstPath = true ) {
* @todo Move this UI stuff somewhere else
*
* @see ContentHandler::getActionOverrides
* @todo Move this UI stuff somewhere else
*
* @see ContentHandler::getActionOverrides
*/
public function getActionOverrides() {
return $this->getContentHandler()->getActionOverrides();
*/
public function getActionOverrides() {
return $this->getContentHandler()->getActionOverrides();
* @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 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
* @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
* return value is suitable for writing back via setText() but is not valid
* for display to the user.
*
* return value is suitable for writing back via setText() but is not valid
* for display to the user.
*
* @since 1.27
*/
public function getRawText() {
* @since 1.27
*/
public function getRawText() {
$this->mSpeculativeRevId = $id;
}
$this->mSpeculativeRevId = $id;
}
+ /**
+ * @return int|null
+ * @since 1.28
+ */
public function getSpeculativeRevIdUsed() {
return $this->mSpeculativeRevId;
}
public function getSpeculativeRevIdUsed() {
return $this->mSpeculativeRevId;
}
* @since 1.25
*/
public function getIndicators() {
* @since 1.25
*/
public function getIndicators() {
return $this->mModuleStyles;
}
return $this->mModuleStyles;
}
+ /**
+ * @return array
+ * @since 1.23
+ */
public function getJsConfigVars() {
return $this->mJsConfigVars;
}
public function getJsConfigVars() {
return $this->mJsConfigVars;
}
+ * @param string $id
+ * @param string $content
* @since 1.25
*/
public function setIndicator( $id, $content ) {
* @since 1.25
*/
public function setIndicator( $id, $content ) {
* @code
* $parser->getOutput()->my_ext_foo = '...';
* @endcode
* @code
* $parser->getOutput()->my_ext_foo = '...';
* @endcode
+ * @param string $name
+ * @param mixed $value
*/
public function setProperty( $name, $value ) {
$this->mProperties[$name] = $value;
*/
public function setProperty( $name, $value ) {
$this->mProperties[$name] = $value;
*
* @param string $text
* @param int $flags
*
* @param string $text
* @param int $flags
*/
protected function cacheSetTree( $text, $flags, $tree ) {
$config = RequestContext::getMain()->getConfig();
*/
protected function cacheSetTree( $text, $flags, $tree ) {
$config = RequestContext::getMain()->getConfig();
/**
* Like splitArg() but for a raw child array. For internal use only.
/**
* Like splitArg() but for a raw child array. For internal use only.
+ * @param array $children
+ * @return array
*/
public static function splitRawArg( array $children ) {
$bits = [];
*/
public static function splitRawArg( array $children ) {
$bits = [];
/**
* Like splitExt() but for a raw child array. For internal use only.
/**
* Like splitExt() but for a raw child array. For internal use only.
+ * @param array $children
+ * @return array
*/
public static function splitRawExt( array $children ) {
$bits = [];
*/
public static function splitRawExt( array $children ) {
$bits = [];
/**
* Like splitHeading() but for a raw child array. For internal use only.
/**
* Like splitHeading() but for a raw child array. For internal use only.
+ * @param array $children
+ * @return array
*/
public static function splitRawHeading( array $children ) {
$bits = [];
*/
public static function splitRawHeading( array $children ) {
$bits = [];
/**
* Like splitTemplate() but for a raw child array. For internal use only.
/**
* Like splitTemplate() but for a raw child array. For internal use only.
+ * @param array $children
+ * @return array
*/
public static function splitRawTemplate( array $children ) {
$parts = [];
*/
public static function splitRawTemplate( array $children ) {
$parts = [];
class IRCColourfulRCFeedFormatter implements RCFeedFormatter {
/**
* @see RCFeedFormatter::getLine
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,
*/
public function getLine( array $feed, RecentChange $rc, $actionComment ) {
global $wgUseRCPatrol, $wgUseNPPatrol, $wgLocalInterwikis,
/**
* Generates a notification that can be easily interpreted by a machine.
* @see RCFeedFormatter::getLine
/**
* 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;
*/
public function getLine( array $feed, RecentChange $rc, $actionComment ) {
global $wgCanonicalServer, $wgServerName, $wgScriptPath;
/**
* @see FormattedRCFeed::send
/**
* @see FormattedRCFeed::send
+ * @param array $feed
+ * @param string $line
+ * @return bool
*/
public function send( array $feed, $line ) {
$parsed = wfParseUrl( $feed['uri'] );
*/
public function send( array $feed, $line ) {
$parsed = wfParseUrl( $feed['uri'] );
class UDPRCFeedEngine extends RCFeedEngine {
/**
* @see RCFeedEngine::send
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'] );
*/
public function send( array $feed, $line ) {
$transport = UDPTransport::newFromString( $feed['uri'] );
/**
* Helper method for getDefinitionSummary.
/**
* Helper method for getDefinitionSummary.
+ * @param ResourceLoaderContext $context
+ * @return array
*/
protected function getFileHashes( ResourceLoaderContext $context ) {
$this->loadFromDefinition();
*/
protected function getFileHashes( ResourceLoaderContext $context ) {
$this->loadFromDefinition();
+ * @param ResourceLoaderContext|null $context
* @return array
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
* @return array
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
+ * @param ResourceLoaderContext $context
* @return array
*/
public function getPreloadLinks( ResourceLoaderContext $context ) {
* @return array
*/
public function getPreloadLinks( ResourceLoaderContext $context ) {
protected $targets = [ 'desktop', 'mobile' ];
/**
protected $targets = [ 'desktop', 'mobile' ];
/**
+ * @param ResourceLoaderContext $context
* @return string JavaScript code
*/
public function getScript( ResourceLoaderContext $context ) {
* @return string JavaScript code
*/
public function getScript( ResourceLoaderContext $context ) {
+ * @param ResourceLoaderContext|null $context
* @return array
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
* @return array
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
/**
* Get a list of categories, as an array with title text strings.
*
/**
* Get a list of categories, as an array with title text strings.
*
+ * @param ParserOutput $parserOutput
* @return string[]
*/
public function getCategories( ParserOutput $parserOutput ) {
* @return string[]
*/
public function getCategories( ParserOutput $parserOutput ) {
/**
* Get a list of external links from ParserOutput, as an array of strings.
*
/**
* Get a list of external links from ParserOutput, as an array of strings.
*
+ * @param ParserOutput $parserOutput
* @return string[]
*/
public function getExternalLinks( ParserOutput $parserOutput ) {
* @return string[]
*/
public function getExternalLinks( ParserOutput $parserOutput ) {
* Get a list of outgoing wiki links (including interwiki links), as
* an array of prefixed title strings.
*
* 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 ) {
* @return string[]
*/
public function getOutgoingLinks( ParserOutput $parserOutput ) {
/**
* Get a list of templates used in the ParserOutput content, as prefixed title strings
*
/**
* Get a list of templates used in the ParserOutput content, as prefixed title strings
*
+ * @param ParserOutput $parserOutput
* @return string[]
*/
public function getTemplates( ParserOutput $parserOutput ) {
* @return string[]
*/
public function getTemplates( ParserOutput $parserOutput ) {
* might support more. The default in all implementations should be 'relevance.'
*
* @since 1.25
* 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' ];
*/
public function getValidSorts() {
return [ 'relevance' ];
/**
* Return a result set of hits on other (multiple) wikis associated with this one
*
/**
* Return a result set of hits on other (multiple) wikis associated with this one
*
* @return SearchResultSet[]
*/
function getInterwikiResults( $type = self::SECONDARY_RESULTS ) {
* @return SearchResultSet[]
*/
function getInterwikiResults( $type = self::SECONDARY_RESULTS ) {
/**
* Check if there are results on other wikis
*
/**
* Check if there are results on other wikis
*
* @return bool
*/
function hasInterwikiResults( $type = self::SECONDARY_RESULTS ) {
* @return bool
*/
function hasInterwikiResults( $type = self::SECONDARY_RESULTS ) {
/**
* Move the suggestion at index $key to the first position
/**
* Move the suggestion at index $key to the first position
*/
public function rescore( $key ) {
$removed = array_splice( $this->suggestions, $key, 1 );
*/
public function rescore( $key ) {
$removed = array_splice( $this->suggestions, $key, 1 );
/**
* @codeCoverageIgnore
/**
* @codeCoverageIgnore
*/
public function preventSessionsForUser( $username ) {
BotPassword::removeAllPasswordsForUser( $username );
*/
public function preventSessionsForUser( $username ) {
BotPassword::removeAllPasswordsForUser( $username );
/**
* @note Despite the name, this seems to be intended to implement isset()
* rather than array_key_exists(). So do that.
/**
* @note Despite the name, this seems to be intended to implement isset()
* rather than array_key_exists(). So do that.
*/
public function offsetExists( $offset ) {
$data = &$this->backend->getData();
*/
public function offsetExists( $offset ) {
$data = &$this->backend->getData();
* 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.
* 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.
*/
public function &offsetGet( $offset ) {
$data = &$this->backend->getData();
*/
public function &offsetGet( $offset ) {
$data = &$this->backend->getData();
/**
* 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.
/**
* 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.
*/
public function clear() {
$this->sites = [];
*/
public function clear() {
$this->sites = [];
/**
* @todo is this even used?
/**
* @todo is this even used?
+ * @param string $name
+ * @param string $urlaction
+ * @return array
*/
function makeArticleUrlDetails( $name, $urlaction = '' ) {
$title = Title::newFromText( $name );
*/
function makeArticleUrlDetails( $name, $urlaction = '' ) {
$title = Title::newFromText( $name );
* ChangesListFilterGroup constructors.
*
* There is light processing to simplify core maintenance.
* ChangesListFilterGroup constructors.
*
* There is light processing to simplify core maintenance.
+ * @param array $definition
*/
protected function registerFiltersFromDefinitions( array $definition ) {
$autoFillPriority = -1;
*/
protected function registerFiltersFromDefinitions( array $definition ) {
$autoFillPriority = -1;
/**
* @param string|null $subpage
/**
* @param string|null $subpage
*/
public function execute( $subpage ) {
$redirect = $this->getRedirect( $subpage );
*/
public function execute( $subpage ) {
$redirect = $this->getRedirect( $subpage );
* @note This will only be run if the page is cached (ie $wgMiserMode = true)
* unless forceExistenceCheck() is true.
* @since 1.24
* @note This will only be run if the page is cached (ie $wgMiserMode = true)
* unless forceExistenceCheck() is true.
* @since 1.24
* @return bool
*/
protected function existenceCheck( Title $title ) {
* @return bool
*/
protected function existenceCheck( Title $title ) {
/**
* @param int $ns The namespace of the article
* @param string $text The name of the article
/**
* @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 == '' ) {
*/
protected function getNamespaceKeyAndText( $ns, $text ) {
if ( $text == '' ) {
* @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
* @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;
*/
public static function getTargetAndType( $par, WebRequest $request = null ) {
$i = 0;
*
* @see T130058
* @todo FIXME This special page should not use LIMIT for paging
*
* @see T130058
* @todo FIXME This special page should not use LIMIT for paging
*/
protected function getMaxResults() {
return max( parent::getMaxResults(), 60000 );
*/
protected function getMaxResults() {
return max( parent::getMaxResults(), 60000 );
- * @param stdClass $row Result row from recent changes
+ * @param stdClass $result Result row from recent changes
* @return Revision|bool
*/
protected function revisionFromRcResult( stdClass $result ) {
* @return Revision|bool
*/
protected function revisionFromRcResult( stdClass $result ) {
/**
* Under which header this special page is listed in Special:SpecialPages.
/**
* Under which header this special page is listed in Special:SpecialPages.
*/
protected function getGroupName() {
return 'users';
*/
protected function getGroupName() {
return 'users';
* This controls js: mw.config.get( 'wgFileCanRotate' )
*
* @todo What about non-BitmapHandler handled files?
* This controls js: mw.config.get( 'wgFileCanRotate' )
*
* @todo What about non-BitmapHandler handled files?
*/
public static function rotationEnabled() {
$bitmapHandler = new BitmapHandler();
*/
public static function rotationEnabled() {
$bitmapHandler = new BitmapHandler();
* In its own function to allow subclasses to override.
* @see SpecialWantedFilesGUOverride in GlobalUsage extension.
* @since 1.24
* In its own function to allow subclasses to override.
* @see SpecialWantedFilesGUOverride in GlobalUsage extension.
* @since 1.24
*/
protected function likelyToHaveFalsePositives() {
return RepoGroup::singleton()->hasForeignRepos();
*/
protected function likelyToHaveFalsePositives() {
return RepoGroup::singleton()->hasForeignRepos();
* Use wfFindFile so we still think file namespace pages without
* files are missing, but valid file redirects and foreign files are ok.
*
* Use wfFindFile so we still think file namespace pages without
* files are missing, but valid file redirects and foreign files are ok.
*
* @return bool
*/
protected function existenceCheck( Title $title ) {
* @return bool
*/
protected function existenceCheck( Title $title ) {
/**
* Get a string key for the Noah's Ark algorithm
/**
* Get a string key for the Noah's Ark algorithm
*/
public function getNoahKey() {
if ( $this->noahKey === null ) {
*/
public function getNoahKey() {
if ( $this->noahKey === null ) {
/**
* Insert a comment at the appropriate place for inserting a node.
* @param string $value Content of the comment.
/**
* Insert a comment at the appropriate place for inserting a node.
* @param string $value Content of the comment.
* @see https://html.spec.whatwg.org/multipage/syntax.html#insert-a-comment
*/
public function insertComment( $value ) {
* @see https://html.spec.whatwg.org/multipage/syntax.html#insert-a-comment
*/
public function insertComment( $value ) {
* Insert text at the appropriate place for inserting a node.
* @param string $value
* @param bool $isComment
* Insert text at the appropriate place for inserting a node.
* @param string $value
* @param bool $isComment
* @see https://html.spec.whatwg.org/multipage/syntax.html#appropriate-place-for-inserting-a-node
*/
public function insertText( $value, $isComment = false ) {
* @see https://html.spec.whatwg.org/multipage/syntax.html#appropriate-place-for-inserting-a-node
*/
public function insertText( $value, $isComment = false ) {
/**
* Return the adjusted current node.
/**
* Return the adjusted current node.
+ * @param string $fragmentContext
+ * @return string
*/
public function adjustedCurrentNode( $fragmentContext ) {
return ( $fragmentContext && count( $this->elements ) === 1 ) ?
*/
public function adjustedCurrentNode( $fragmentContext ) {
return ( $fragmentContext && count( $this->elements ) === 1 ) ?
* 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".
* 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;
*/
public function findElementByTag( $tag ) {
$elt = $this->tail;
/**
* Return true if validate() can be used
/**
* Return true if validate() can be used
*/
public function supportsValidate() {
return false;
*/
public function supportsValidate() {
return false;
- * @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 ) {
* @return array List of FQCN detected within the tokens
*/
public function getClasses( $code ) {
*
* @param string $text Text to be converted
* @param string $variant The target variant code
*
* @param string $text Text to be converted
* @param string $variant The target variant code
+ * @param int &$startPos
* @param int $depth Depth of recursion
*
* @throws MWException
* @param int $depth Depth of recursion
*
* @throws MWException
* This function has the same parameters as wfGetDB()
*
* @param int $db DB index (DB_REPLICA/DB_MASTER)
* 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 ) {
* @return IMaintainableDatabase
*/
protected function getDB( $db, $groups = [], $wiki = false ) {
/**
* Imports the site described by the parameters (see self::__construct()) passed to this
* maintenance sccript into the sites table of MediaWiki.
/**
* Imports the site described by the parameters (see self::__construct()) passed to this
* maintenance sccript into the sites table of MediaWiki.
*/
public function execute() {
$siteStore = MediaWikiServices::getInstance()->getSiteStore();
*/
public function execute() {
$siteStore = MediaWikiServices::getInstance()->getSiteStore();
/**
* Check whether a function or method includes a call to wfDeprecated(),
* indicating that it is a hard-deprecated interface.
/**
* 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 ) {
*/
public function isHardDeprecated( PhpParser\Node $node ) {
if ( !$node->stmts ) {
/**
* gzwrite() / fwrite() wrapper
*
/**
* gzwrite() / fwrite() wrapper
*
- * @param resource $handle
+ * @param resource &$handle
* @param string $str
*/
function write( &$handle, $str ) {
* @param string $str
*/
function write( &$handle, $str ) {
/**
* gzclose() / fclose() wrapper
*
/**
* gzclose() / fclose() wrapper
*
- * @param resource $handle
+ * @param resource &$handle
*/
function close( &$handle ) {
if ( $this->compress ) {
*/
function close( &$handle ) {
if ( $this->compress ) {
* comment ID field.
* Blanks the old fields while migrating.
*
* 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.
* @param string $primaryKey Primary key of the table.
* @param string $oldField Old comment field name
* @param string $newPrimaryKey Primary key of the new table.
/**
* Dumb stuff to run a mode.
/**
* Dumb stuff to run a mode.
*/
public function run() {
if ( !$this->mReady ) {
*/
public function run() {
if ( !$this->mReady ) {
/**
* Asserts that the cookie jar does not have the given cookie.
/**
* 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 ) {
* @param CookieJar $cookieJar
*/
protected function assertNotHasCookie( $name, CookieJar $cookieJar ) {
/**
* This should be called before the table prefix is changed
/**
* 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;
*/
function __construct( $db, $filter = false ) {
$this->db = $db;
/**
* Show a warning to the user
/**
* Show a warning to the user
+ * @param string $message
*/
public function warning( $message ) {
echo "$message\n";
*/
public function warning( $message ) {
echo "$message\n";
/**
* Mark a test skipped
/**
* Mark a test skipped
+ * @param string $test
+ * @param string $subtest
*/
public function skipped( $test, $subtest ) {
if ( $this->showProgress ) {
*/
public function skipped( $test, $subtest ) {
if ( $this->showProgress ) {
/**
* Serialize the XML DOM for comparison purposes. This does not generate HTML.
/**
* Serialize the XML DOM for comparison purposes. This does not generate HTML.
*/
protected function serialize() {
return strtr( $this->doc->saveXML( $this->body ),
*/
protected function serialize() {
return strtr( $this->doc->saveXML( $this->body ),
/**
* Ensure a given setup stage has been done, throw an exception if it has
* not.
/**
* 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]
*/
protected function checkSetupDone( $funcName, $funcName2 = null ) {
if ( !$this->setupDone[$funcName]
/**
* Determine whether the current parser has the hooks registered in it
* that are required by a file read by TestFileReader.
/**
* 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 ) {
*/
public function meetsRequirements( $requirements ) {
foreach ( $requirements as $requirement ) {
/**
* Mark a test skipped
/**
* Mark a test skipped
+ * @param string $test
+ * @param string $reason
*/
public function skipped( $test, $reason ) {
$this->testCase->markTestSkipped( "SKIPPED: $reason" );
*/
public function skipped( $test, $reason ) {
$this->testCase->markTestSkipped( "SKIPPED: $reason" );
/**
* Determine if there is a usable tidy.
/**
* Determine if there is a usable tidy.
+ * @param bool $useConfiguration
*/
public function __construct( $useConfiguration = false ) {
global $IP, $wgUseTidy, $wgTidyBin, $wgTidyInternal, $wgTidyConfig,
*/
public function __construct( $useConfiguration = false ) {
global $IP, $wgUseTidy, $wgTidyBin, $wgTidyInternal, $wgTidyConfig,
*
* @param Config|null $bootstrapConfig The bootstrap config to use with the new
* MediaWikiServices.
*
* @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();
*/
protected static function resetGlobalServices( Config $bootstrapConfig = null ) {
$oldServices = MediaWikiServices::getInstance();
*/
protected function objectAssociativeSort( array &$array ) {
uasort(
*/
protected function objectAssociativeSort( array &$array ) {
uasort(
- * @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 ) ) {
*/
protected static function stripStringKeys( &$r ) {
if ( !is_array( $r ) ) {
/**
* Used as a marker to prevent wfResetOutputBuffers from breaking PHPUnit.
/**
* Used as a marker to prevent wfResetOutputBuffers from breaking PHPUnit.
+ * @param string $buffer
* @return string
*/
public static function wfResetOutputBuffersBarrier( $buffer ) {
* @return string
*/
public static function wfResetOutputBuffersBarrier( $buffer ) {
* - string 'modules' Pipe-separated list of module names
* - string|null 'only' "scripts" (unwrapped script), "styles" (stylesheet), or null
* (mw.loader.implement).
* - 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 ) {
* @return ResourceLoaderContext
*/
protected function getResourceLoaderContext( $options = [], ResourceLoader $rl = null ) {
/**
* Returns SQL queries grouped by '; '
* Clear the list of queries that have been done so far.
/**
* Returns SQL queries grouped by '; '
* Clear the list of queries that have been done so far.
*/
public function getLastSqls() {
$lastSqls = implode( '; ', $this->lastSqls );
*/
public function getLastSqls() {
$lastSqls = implode( '; ', $this->lastSqls );
* @param User|null $user The user which should be used in the context of this special page
*
* @throws Exception
* @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(
* generated by the special page as well as the response object.
*/
public function executeSpecialPage(
* @param User|null $user The user which should be used in the context of this special page
*
* @throws Exception
* @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(
* generated by the special page as well as the response object.
*/
protected function executeSpecialPage(
/**
* Creates an empty Content object of the type supported by this ContentHandler.
/**
* Creates an empty Content object of the type supported by this ContentHandler.
+ * @return DummyContentForTesting
*/
public function makeEmptyContent() {
return new DummyContentForTesting( '' );
*/
public function makeEmptyContent() {
return new DummyContentForTesting( '' );
/**
* Creates an empty Content object of the type supported by this ContentHandler.
/**
* Creates an empty Content object of the type supported by this ContentHandler.
+ * @return DummyNonTextContent
*/
public function makeEmptyContent() {
return new DummyNonTextContent( '' );
*/
public function makeEmptyContent() {
return new DummyNonTextContent( '' );
/**
* August 22 – The theft of the Mona Lisa is discovered in the Louvre."
* T22281
/**
* August 22 – The theft of the Mona Lisa is discovered in the Louvre."
* T22281
*/
public function getSize() {
return 1911;
*/
public function getSize() {
return 1911;