Merge "Improve some parameter docs"
This commit is contained in:
commit
45a6ddfcd0
107 changed files with 264 additions and 52 deletions
|
|
@ -56,6 +56,7 @@ class AjaxDispatcher {
|
|||
|
||||
/**
|
||||
* Load up our object with user supplied data
|
||||
* @param Config $config
|
||||
*/
|
||||
function __construct( Config $config ) {
|
||||
$this->config = $config;
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class OrderedStreamingForkController extends ForkController {
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function start() {
|
||||
if ( $this->procsToStart > 0 ) {
|
||||
|
|
|
|||
|
|
@ -228,6 +228,7 @@ class Pingback {
|
|||
*
|
||||
* The schema for the data is located at:
|
||||
* <https://meta.wikimedia.org/wiki/Schema:MediaWikiPingback>
|
||||
* @return bool
|
||||
*/
|
||||
public function sendPingback() {
|
||||
if ( !$this->acquireLock() ) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -1870,7 +1870,7 @@ class ApiMain extends ApiBase {
|
|||
];
|
||||
}
|
||||
|
||||
/** @see ApiBase::getExamplesMessages() */
|
||||
/** @inheritDoc */
|
||||
protected function getExamplesMessages() {
|
||||
return [
|
||||
'action=help'
|
||||
|
|
|
|||
|
|
@ -97,9 +97,7 @@ abstract class ApiQueryBase extends ApiBase {
|
|||
return $this->mQueryModule;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ApiBase::getParent()
|
||||
*/
|
||||
/** @inheritDoc */
|
||||
public function getParent() {
|
||||
return $this->getQuery();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ class ApiUsageException extends UsageException implements ILocalizedException {
|
|||
}
|
||||
|
||||
/**
|
||||
* @returns ApiMessage
|
||||
* @return ApiMessage
|
||||
*/
|
||||
private function getApiMessage() {
|
||||
$errors = $this->status->getErrorsByType( 'error' );
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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[]
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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()." );
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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'] );
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -168,6 +168,7 @@ class Http {
|
|||
/**
|
||||
* Get a configured MultiHttpClient
|
||||
* @param array $options
|
||||
* @return MultiHttpClient
|
||||
*/
|
||||
public static function createMultiClient( $options = [] ) {
|
||||
global $wgHTTPConnectTimeout, $wgHTTPTimeout, $wgHTTPProxy;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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__ ) ) {
|
||||
|
|
|
|||
|
|
@ -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, '/' );
|
||||
|
|
|
|||
|
|
@ -1005,6 +1005,7 @@ class WebInstaller extends Installer {
|
|||
*
|
||||
* @see getRadioSet
|
||||
*
|
||||
* @param mixed[] $params
|
||||
* @return array
|
||||
*/
|
||||
public function getRadioElements( $params ) {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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() ) {
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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 = [];
|
||||
|
|
|
|||
|
|
@ -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__,
|
||||
|
|
|
|||
|
|
@ -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 = '`' ) {
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -146,6 +146,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'] );
|
||||
|
|
|
|||
|
|
@ -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'] );
|
||||
|
|
|
|||
|
|
@ -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' );
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
@ -2733,6 +2734,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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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 = [];
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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'] );
|
||||
|
|
|
|||
|
|
@ -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'] );
|
||||
|
|
|
|||
|
|
@ -427,6 +427,8 @@ class ResourceLoaderImageModule extends ResourceLoaderModule {
|
|||
|
||||
/**
|
||||
* Helper method for getDefinitionSummary.
|
||||
* @param ResourceLoaderContext $context
|
||||
* @return array
|
||||
*/
|
||||
protected function getFileHashes( ResourceLoaderContext $context ) {
|
||||
$this->loadFromDefinition();
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ class ResourceLoaderSiteModule extends ResourceLoaderWikiModule {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param ResourceLoaderContext|null $context
|
||||
* @return array
|
||||
*/
|
||||
public function getDependencies( ResourceLoaderContext $context = null ) {
|
||||
|
|
|
|||
|
|
@ -297,6 +297,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param ResourceLoaderContext $context
|
||||
* @return array
|
||||
*/
|
||||
public function getPreloadLinks( ResourceLoaderContext $context ) {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ class ResourceLoaderUploadDialogModule extends ResourceLoaderModule {
|
|||
protected $targets = [ 'desktop', 'mobile' ];
|
||||
|
||||
/**
|
||||
* @param ResourceLoaderContext $context
|
||||
* @return string JavaScript code
|
||||
*/
|
||||
public function getScript( ResourceLoaderContext $context ) {
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ class ResourceLoaderUserModule extends ResourceLoaderWikiModule {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param ResourceLoaderContext|null $context
|
||||
* @return array
|
||||
*/
|
||||
public function getDependencies( ResourceLoaderContext $context = null ) {
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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' ];
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -167,6 +167,7 @@ class BotPasswordSessionProvider extends ImmutableSessionProviderWithCookie {
|
|||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function preventSessionsForUser( $username ) {
|
||||
BotPassword::removeAllPasswordsForUser( $username );
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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 = [];
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage {
|
|||
|
||||
/**
|
||||
* @param string|null $subpage
|
||||
* @return Title|bool
|
||||
*/
|
||||
public function execute( $subpage ) {
|
||||
$redirect = $this->getRedirect( $subpage );
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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 == '' ) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ abstract class TidyDriverBase {
|
|||
|
||||
/**
|
||||
* Return true if validate() can be used
|
||||
* @return bool
|
||||
*/
|
||||
public function supportsValidate() {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ class ClassCollector {
|
|||
protected $alias;
|
||||
|
||||
/**
|
||||
* @var string $code PHP code (including <?php) to detect class names from
|
||||
* @param string $code PHP code (including <?php) to detect class names from
|
||||
* @return array List of FQCN detected within the tokens
|
||||
*/
|
||||
public function getClasses( $code ) {
|
||||
|
|
|
|||
|
|
@ -662,7 +662,7 @@ class LanguageConverter {
|
|||
*
|
||||
* @param string $text Text to be converted
|
||||
* @param string $variant The target variant code
|
||||
* @param int $startPos
|
||||
* @param int &$startPos
|
||||
* @param int $depth Depth of recursion
|
||||
*
|
||||
* @throws MWException
|
||||
|
|
|
|||
|
|
@ -1244,8 +1244,8 @@ abstract class Maintenance {
|
|||
* This function has the same parameters as wfGetDB()
|
||||
*
|
||||
* @param int $db DB index (DB_REPLICA/DB_MASTER)
|
||||
* @param array $groups; default: empty array
|
||||
* @param string|bool $wiki; default: current wiki
|
||||
* @param array $groups default: empty array
|
||||
* @param string|bool $wiki default: current wiki
|
||||
* @return IMaintainableDatabase
|
||||
*/
|
||||
protected function getDB( $db, $groups = [], $wiki = false ) {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class AddSite extends Maintenance {
|
|||
/**
|
||||
* Imports the site described by the parameters (see self::__construct()) passed to this
|
||||
* maintenance sccript into the sites table of MediaWiki.
|
||||
* @return bool
|
||||
*/
|
||||
public function execute() {
|
||||
$siteStore = MediaWikiServices::getInstance()->getSiteStore();
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ class UserOptions {
|
|||
|
||||
/**
|
||||
* Dumb stuff to run a mode.
|
||||
* @return bool
|
||||
*/
|
||||
public function run() {
|
||||
if ( !$this->mReady ) {
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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 ),
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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" );
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 ) {
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue