Auto fix MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam sniff
Change-Id: I865323fd0295aabd06f3e3c75e0e5043fb31069e
206 files changed:
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
<exclude name="MediaWiki.Commenting.FunctionComment.ExtraParamComment" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
<exclude name="MediaWiki.Commenting.FunctionComment.ExtraParamComment" />
- <exclude name="MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam" />
<exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" />
<exclude name="MediaWiki.Commenting.PhpunitAnnotations.NotClassTrait" />
<exclude name="MediaWiki.Commenting.IllegalSingleLineComment.IllegalSingleLineCommentStart" />
<exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" />
<exclude name="MediaWiki.Commenting.PhpunitAnnotations.NotClassTrait" />
<exclude name="MediaWiki.Commenting.IllegalSingleLineComment.IllegalSingleLineCommentStart" />
* 1) A block directly on the given user or IP
* 2) A rangeblock encompassing the given IP (smallest first)
* 3) An autoblock on the given IP
* 1) A block directly on the given user or IP
* 2) A rangeblock encompassing the given IP (smallest first)
* 3) An autoblock on the given IP
- * @param User|string $vagueTarget Also search for blocks affecting this target. Doesn't
+ * @param User|string|null $vagueTarget Also search for blocks affecting this target. Doesn't
* make any sense to use TYPE_AUTO / TYPE_ID here. Leave blank to skip IP lookups.
* @throws MWException
* @return bool Whether a relevant block was found
* make any sense to use TYPE_AUTO / TYPE_ID here. Leave blank to skip IP lookups.
* @throws MWException
* @return bool Whether a relevant block was found
/**
* Get a set of SQL conditions which will select rangeblocks encompassing a given range
* @param string $start Hexadecimal IP representation
/**
* Get a set of SQL conditions which will select rangeblocks encompassing a given range
* @param string $start Hexadecimal IP representation
- * @param string $end Hexadecimal IP representation, or null to use $start = $end
+ * @param string|null $end Hexadecimal IP representation, or null to use $start = $end
* @return string
*/
public static function getRangeCond( $start, $end = null ) {
* @return string
*/
public static function getRangeCond( $start, $end = null ) {
* Insert a block into the block table. Will fail if there is a conflicting
* block (same name and options) already in the database.
*
* Insert a block into the block table. Will fail if there is a conflicting
* block (same name and options) already in the database.
*
- * @param IDatabase $dbw If you have one available
+ * @param IDatabase|null $dbw If you have one available
* @return bool|array False on failure, assoc array on success:
* ('id' => block ID, 'autoIds' => array of autoblock IDs)
*/
* @return bool|array False on failure, assoc array on success:
* ('id' => block ID, 'autoIds' => array of autoblock IDs)
*/
* Calling this with a user, IP address or range will not select autoblocks, and will
* only select a block where the targets match exactly (so looking for blocks on
* 1.2.3.4 will not select 1.2.0.0/16 or even 1.2.3.4/32)
* Calling this with a user, IP address or range will not select autoblocks, and will
* only select a block where the targets match exactly (so looking for blocks on
* 1.2.3.4 will not select 1.2.0.0/16 or even 1.2.3.4/32)
- * @param string|User|int $vagueTarget As above, but we will search for *any* block which
+ * @param string|User|int|null $vagueTarget As above, but we will search for *any* block which
* affects that target (so for an IP address, get ranges containing that IP; and also
* get any relevant autoblocks). Leave empty or blank to skip IP-based lookups.
* @param bool $fromMaster Whether to use the DB_MASTER database
* affects that target (so for an IP address, get ranges containing that IP; and also
* get any relevant autoblocks). Leave empty or blank to skip IP-based lookups.
* @param bool $fromMaster Whether to use the DB_MASTER database
* fields are null, the resulting Category object will represent an empty
* category if a title object was given. If the fields are null and no
* title was given, this method fails and returns false.
* fields are null, the resulting Category object will represent an empty
* category if a title object was given. If the fields are null and no
* title was given, this method fails and returns false.
- * @param Title $title Optional title object for the category represented by
+ * @param Title|null $title Optional title object for the category represented by
* the given row. May be provided if it is already known, to avoid having
* to re-create a title object later.
* @return Category|false
* the given row. May be provided if it is already known, to avoid having
* to re-create a title object later.
* @return Category|false
*
* @since 1.30
* @since 1.31 Method signature changed, $key parameter added (with deprecated back compat)
*
* @since 1.30
* @since 1.31 Method signature changed, $key parameter added (with deprecated back compat)
- * @param string $key A key such as "rev_comment" identifying the comment
+ * @param string|null $key A key such as "rev_comment" identifying the comment
* field being fetched.
* @return string[] to include in the `$vars` to `IDatabase->select()`. All
* fields are aliased, so `+` is safe to use.
* field being fetched.
* @return string[] to include in the `$vars` to `IDatabase->select()`. All
* fields are aliased, so `+` is safe to use.
*
* @since 1.30
* @since 1.31 Method signature changed, $key parameter added (with deprecated back compat)
*
* @since 1.30
* @since 1.31 Method signature changed, $key parameter added (with deprecated back compat)
- * @param string $key A key such as "rev_comment" identifying the comment
+ * @param string|null $key A key such as "rev_comment" identifying the comment
* field being fetched.
* @return array With three keys:
* - tables: (string[]) to include in the `$table` to `IDatabase->select()`
* field being fetched.
* @return array With three keys:
* - tables: (string[]) to include in the `$table` to `IDatabase->select()`
* @since 1.31 Method signature changed, $key parameter added (with deprecated back compat)
* @param string $key A key such as "rev_comment" identifying the comment
* field being fetched.
* @since 1.31 Method signature changed, $key parameter added (with deprecated back compat)
* @param string $key A key such as "rev_comment" identifying the comment
* field being fetched.
- * @param object|array $row Result row.
+ * @param object|array|null $row Result row.
* @param bool $fallback If true, fall back as well as possible instead of throwing an exception.
* @return CommentStoreComment
*/
* @param bool $fallback If true, fall back as well as possible instead of throwing an exception.
* @return CommentStoreComment
*/
* @param IDatabase $db Database handle to use for lookup
* @param string $key A key such as "rev_comment" identifying the comment
* field being fetched.
* @param IDatabase $db Database handle to use for lookup
* @param string $key A key such as "rev_comment" identifying the comment
* field being fetched.
- * @param object|array $row Result row.
+ * @param object|array|null $row Result row.
* @param bool $fallback If true, fall back as well as possible instead of throwing an exception.
* @return CommentStoreComment
*/
* @param bool $fallback If true, fall back as well as possible instead of throwing an exception.
* @return CommentStoreComment
*/
* @param IDatabase $dbw Database handle to insert on
* @param string $key A key such as "rev_comment" identifying the comment
* field being fetched.
* @param IDatabase $dbw Database handle to insert on
* @param string $key A key such as "rev_comment" identifying the comment
* field being fetched.
- * @param string|Message|CommentStoreComment $comment As for `self::createComment()`
+ * @param string|Message|CommentStoreComment|null $comment As for `self::createComment()`
* @param array|null $data As for `self::createComment()`
* @return array Fields for the insert or update
*/
* @param array|null $data As for `self::createComment()`
* @return array Fields for the insert or update
*/
* @param IDatabase $dbw Database handle to insert on
* @param string $key A key such as "rev_comment" identifying the comment
* field being fetched.
* @param IDatabase $dbw Database handle to insert on
* @param string $key A key such as "rev_comment" identifying the comment
* field being fetched.
- * @param string|Message|CommentStoreComment $comment As for `self::createComment()`
+ * @param string|Message|CommentStoreComment|null $comment As for `self::createComment()`
* @param array|null $data As for `self::createComment()`
* @return array Two values:
* - array Fields for the insert or update
* @param array|null $data As for `self::createComment()`
* @return array Two values:
* - array Fields for the insert or update
* Builds a standard summary input with a label.
*
* @param string $summary The value of the summary input
* Builds a standard summary input with a label.
*
* @param string $summary The value of the summary input
- * @param string $labelText The html to place inside the label
- * @param array $inputAttrs Array of attrs to use on the input
+ * @param string|null $labelText The html to place inside the label
+ * @param array|null $inputAttrs Array of attrs to use on the input
*
* @return OOUI\FieldLayout OOUI FieldLayout with Label and Input
*/
*
* @return OOUI\FieldLayout OOUI FieldLayout with Label and Input
*/
* The $textoverride method can be used by subclasses overriding showContentForm
* to pass back to this method.
*
* The $textoverride method can be used by subclasses overriding showContentForm
* to pass back to this method.
*
- * @param array $customAttribs Array of html attributes to use in the textarea
- * @param string $textoverride Optional text to override $this->textarea1 with
+ * @param array|null $customAttribs Array of html attributes to use in the textarea
+ * @param string|null $textoverride Optional text to override $this->textarea1 with
*/
protected function showTextbox1( $customAttribs = null, $textoverride = null ) {
if ( $this->wasDeletedSinceLastEdit() && $this->formtype == 'save' ) {
*/
protected function showTextbox1( $customAttribs = null, $textoverride = null ) {
if ( $this->wasDeletedSinceLastEdit() && $this->formtype == 'save' ) {
* Shows a bulletin board style toolbar for common editing functions.
* It can be disabled in the user preferences.
*
* Shows a bulletin board style toolbar for common editing functions.
* It can be disabled in the user preferences.
*
- * @param Title $title Title object for the page being edited (optional)
+ * @param Title|null $title Title object for the page being edited (optional)
* @return string
*/
public static function getEditToolbar( $title = null ) {
* @return string
*/
public static function getEditToolbar( $title = null ) {
* @param string &$oldimage Archive name
* @param string $reason Reason of the deletion
* @param bool $suppress Whether to mark all deleted versions as restricted
* @param string &$oldimage Archive name
* @param string $reason Reason of the deletion
* @param bool $suppress Whether to mark all deleted versions as restricted
- * @param User $user User object performing the request
+ * @param User|null $user User object performing the request
* @param array $tags Tags to apply to the deletion action
* @throws MWException
* @return Status
* @param array $tags Tags to apply to the deletion action
* @throws MWException
* @return Status
* available for accessing with getValue() or consumeValue() etc.
*
* @param WebRequest $r The request to fetch values from
* available for accessing with getValue() or consumeValue() etc.
*
* @param WebRequest $r The request to fetch values from
- * @param array $optionKeys Which options to fetch the values for (default:
+ * @param array|null $optionKeys Which options to fetch the values for (default:
* all of them). Note that passing an empty array will also result in
* values for all keys being fetched.
* @throws MWException If the type of any option is invalid
* all of them). Note that passing an empty array will also result in
* values for all keys being fetched.
* @throws MWException If the type of any option is invalid
* If $wgShowHostnames is true, the script will also set 'wgHostname' to the
* hostname of the server handling the request.
*
* If $wgShowHostnames is true, the script will also set 'wgHostname' to the
* hostname of the server handling the request.
*
- * @param string $nonce Value from OutputPage::getCSPNonce
+ * @param string|null $nonce Value from OutputPage::getCSPNonce
* @return string|WrappedString HTML
*/
function wfReportTime( $nonce = null ) {
* @return string|WrappedString HTML
*/
function wfReportTime( $nonce = null ) {
* For dealing with nullable timestamp columns in the database.
*
* @param int $outputtype
* For dealing with nullable timestamp columns in the database.
*
* @param int $outputtype
+ * @param string|null $ts
* @return string
*/
function wfTimestampOrNull( $outputtype = TS_UNIX, $ts = null ) {
* @return string
*/
function wfTimestampOrNull( $outputtype = TS_UNIX, $ts = null ) {
* Make directory, and make all parent directories if they don't exist
*
* @param string $dir Full path to directory to create
* Make directory, and make all parent directories if they don't exist
*
* @param string $dir Full path to directory to create
- * @param int $mode Chmod value to use, default is $wgDirectoryMode
- * @param string $caller Optional caller param for debugging.
+ * @param int|null $mode Chmod value to use, default is $wgDirectoryMode
+ * @param string|null $caller Optional caller param for debugging.
* @throws MWException
* @return bool
*/
* @throws MWException
* @return bool
*/
* @param string $mine
* @param string $yours
* @param string &$result
* @param string $mine
* @param string $yours
* @param string &$result
- * @param string &$mergeAttemptResult
+ * @param string|null &$mergeAttemptResult
* @return bool
*/
function wfMerge( $old, $mine, $yours, &$result, &$mergeAttemptResult = null ) {
* @return bool
*/
function wfMerge( $old, $mine, $yours, &$result, &$mergeAttemptResult = null ) {
*
* @param string $name The image name to check
* @param Title|bool $contextTitle The page on which the image occurs, if known
*
* @param string $name The image name to check
* @param Title|bool $contextTitle The page on which the image occurs, if known
- * @param string $blacklist Wikitext of a file blacklist
+ * @param string|null $blacklist Wikitext of a file blacklist
* @return bool
*/
function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) {
* @return bool
*/
function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) {
* literal "</script>" or (for XML) literal "]]>".
*
* @param string $contents JavaScript
* literal "</script>" or (for XML) literal "]]>".
*
* @param string $contents JavaScript
- * @param string $nonce Nonce for CSP header, from OutputPage::getCSPNonce()
+ * @param string|null $nonce Nonce for CSP header, from OutputPage::getCSPNonce()
* @return string Raw HTML
*/
public static function inlineScript( $contents, $nonce = null ) {
* @return string Raw HTML
*/
public static function inlineScript( $contents, $nonce = null ) {
* "<script src=foo.js></script>".
*
* @param string $url
* "<script src=foo.js></script>".
*
* @param string $url
- * @param string $nonce Nonce for CSP header, from OutputPage::getCSPNonce()
+ * @param string|null $nonce Nonce for CSP header, from OutputPage::getCSPNonce()
* @return string Raw HTML
*/
public static function linkedScript( $url, $nonce = null ) {
* @return string Raw HTML
*/
public static function linkedScript( $url, $nonce = null ) {
* red if the user has no edits?
* @param int $flags Customisation flags (e.g. Linker::TOOL_LINKS_NOBLOCK
* and Linker::TOOL_LINKS_EMAIL).
* red if the user has no edits?
* @param int $flags Customisation flags (e.g. Linker::TOOL_LINKS_NOBLOCK
* and Linker::TOOL_LINKS_EMAIL).
- * @param int $edits User edit count (optional, for performance)
+ * @param int|null $edits User edit count (optional, for performance)
* @return string HTML fragment
*/
public static function userToolLinks(
* @return string HTML fragment
*/
public static function userToolLinks(
* @since 1.16.3
* @param int $userId User identifier
* @param string $userText User name or IP address
* @since 1.16.3
* @param int $userId User identifier
* @param string $userText User name or IP address
- * @param int $edits User edit count (optional, for performance)
+ * @param int|null $edits User edit count (optional, for performance)
* @return string
*/
public static function userToolLinksRedContribs( $userId, $userText, $edits = null ) {
* @return string
*/
public static function userToolLinksRedContribs( $userId, $userText, $edits = null ) {
* @since 1.16.3. $context added in 1.20. $options added in 1.21
*
* @param Revision $rev
* @since 1.16.3. $context added in 1.20. $options added in 1.21
*
* @param Revision $rev
- * @param IContextSource $context Context to use or null for the main context.
+ * @param IContextSource|null $context Context to use or null for the main context.
* @param array $options
* @return string
*/
* @param array $options
* @return string
*/
*
* @since 1.23
* @param int $index Index to check
*
* @since 1.23
* @param int $index Index to check
- * @param User $user User to check
+ * @param User|null $user User to check
* @return array
*/
public static function getRestrictionLevels( $index, User $user = null ) {
* @return array
*/
public static function getRestrictionLevels( $index, User $user = null ) {
* Generate a purely relative timestamp, i.e., represent the time elapsed between
* the given base timestamp and this object.
*
* Generate a purely relative timestamp, i.e., represent the time elapsed between
* the given base timestamp and this object.
*
- * @param MWTimestamp $relativeTo Relative base timestamp (defaults to now)
- * @param User $user Use to use offset for
- * @param Language $lang Language to use
+ * @param MWTimestamp|null $relativeTo Relative base timestamp (defaults to now)
+ * @param User|null $user Use to use offset for
+ * @param Language|null $lang Language to use
* @param array $chosenIntervals Intervals to use to represent it
* @return string Relative timestamp
*/
* @param array $chosenIntervals Intervals to use to represent it
* @return string Relative timestamp
*/
*
* Use factory instead: MagicWord::get
*
*
* Use factory instead: MagicWord::get
*
- * @param string $id The internal name of the magic word
+ * @param string|null $id The internal name of the magic word
* @param string[]|string $syn synonyms for the magic word
* @param bool $cs If magic word is case sensitive
*/
* @param string[]|string $syn synonyms for the magic word
* @param bool $cs If magic word is case sensitive
*/
/**
* @see MediaWiki::preOutputCommit()
/**
* @see MediaWiki::preOutputCommit()
- * @param callable $postCommitWork [default: null]
+ * @param callable|null $postCommitWork [default: null]
* @since 1.26
*/
public function doPreOutputCommit( callable $postCommitWork = null ) {
* @since 1.26
*/
public function doPreOutputCommit( callable $postCommitWork = null ) {
* the user can receive a response (in case commit fails)
*
* @param IContextSource $context
* the user can receive a response (in case commit fails)
*
* @param IContextSource $context
- * @param callable $postCommitWork [default: null]
+ * @param callable|null $postCommitWork [default: null]
* @since 1.27
*/
public static function preOutputCommit(
* @since 1.27
*/
public static function preOutputCommit(
* message keys to try and use the first non-empty message for, or a
* MessageSpecifier to copy from.
* @param array $params Message parameters.
* message keys to try and use the first non-empty message for, or a
* MessageSpecifier to copy from.
* @param array $params Message parameters.
- * @param Language $language [optional] Language to use (defaults to current user language).
+ * @param Language|null $language [optional] Language to use (defaults to current user language).
* @throws InvalidArgumentException
*/
public function __construct( $key, $params = [], Language $language = null ) {
* @throws InvalidArgumentException
*/
public function __construct( $key, $params = [], Language $language = null ) {
* Internal use only. Use OutputPage::addModules() if possible.
*
* @param string $file URL to file (absolute path, protocol-relative, or full url)
* Internal use only. Use OutputPage::addModules() if possible.
*
* @param string $file URL to file (absolute path, protocol-relative, or full url)
- * @param string $unused Previously used to change the cache-busting query parameter
+ * @param string|null $unused Previously used to change the cache-busting query parameter
*/
public function addScriptFile( $file, $unused = null ) {
if ( substr( $file, 0, 1 ) !== '/' && !preg_match( '#^[a-z]*://#i', $file ) ) {
*/
public function addScriptFile( $file, $unused = null ) {
if ( substr( $file, 0, 1 ) !== '/' && !preg_match( '#^[a-z]*://#i', $file ) ) {
* @param bool $interface Use interface language ($wgLang instead of
* $wgContLang) while parsing language sensitive magic words like GRAMMAR and PLURAL.
* This also disables LanguageConverter.
* @param bool $interface Use interface language ($wgLang instead of
* $wgContLang) while parsing language sensitive magic words like GRAMMAR and PLURAL.
* This also disables LanguageConverter.
- * @param Language $language Target language object, will override $interface
+ * @param Language|null $language Target language object, will override $interface
* @throws MWException
* @return string HTML
*/
* @throws MWException
* @return string HTML
*/
* Output a standard permission error page
*
* @param array $errors Error message keys or [key, param...] arrays
* Output a standard permission error page
*
* @param array $errors Error message keys or [key, param...] arrays
- * @param string $action Action that was denied or null if unknown
+ * @param string|null $action Action that was denied or null if unknown
*/
public function showPermissionsErrorPage( array $errors, $action = null ) {
foreach ( $errors as $key => $error ) {
*/
public function showPermissionsErrorPage( array $errors, $action = null ) {
foreach ( $errors as $key => $error ) {
* Format a list of error messages
*
* @param array $errors Array of arrays returned by Title::getUserPermissionsErrors
* Format a list of error messages
*
* @param array $errors Array of arrays returned by Title::getUserPermissionsErrors
- * @param string $action Action that was denied or null if unknown
+ * @param string|null $action Action that was denied or null if unknown
* @return string The wikitext error-messages, formatted into a list.
*/
public function formatPermissionsErrorMessage( array $errors, $action = null ) {
* @return string The wikitext error-messages, formatted into a list.
*/
public function formatPermissionsErrorMessage( array $errors, $action = null ) {
*
* @param Title $title Title to link
* @param array $query Query string parameters
*
* @param Title $title Title to link
* @param array $query Query string parameters
- * @param string $text Text of the link (input is not escaped)
+ * @param string|null $text Text of the link (input is not escaped)
* @param array $options Options array to pass to Linker
*/
public function addReturnTo( $title, array $query = [], $text = null, $options = [] ) {
* @param array $options Options array to pass to Linker
*/
public function addReturnTo( $title, array $query = [], $text = null, $options = [] ) {
* Add a "return to" link pointing to a specified title,
* or the title indicated in the request, or else the main page
*
* Add a "return to" link pointing to a specified title,
* or the title indicated in the request, or else the main page
*
- * @param mixed $unused
- * @param Title|string $returnto Title or String to return to
- * @param string $returntoquery Query string for the return to link
+ * @param mixed|null $unused
+ * @param Title|string|null $returnto Title or String to return to
+ * @param string|null $returntoquery Query string for the return to link
*/
public function returnToMain( $unused = null, $returnto = null, $returntoquery = null ) {
if ( $returnto == null ) {
*/
public function returnToMain( $unused = null, $returnto = null, $returntoquery = null ) {
if ( $returnto == null ) {
* Add one or more variables to be set in mw.config in JavaScript
*
* @param string|array $keys Key or array of key/value pairs
* Add one or more variables to be set in mw.config in JavaScript
*
* @param string|array $keys Key or array of key/value pairs
- * @param mixed $value [optional] Value of the configuration variable
+ * @param mixed|null $value [optional] Value of the configuration variable
*/
public function addJsConfigVars( $keys, $value = null ) {
if ( is_array( $keys ) ) {
*/
public function addJsConfigVars( $keys, $value = null ) {
if ( is_array( $keys ) ) {
- * @param Config $config
- * @param LoggerInterface $logger
+ * @param Config|null $config
+ * @param LoggerInterface|null $logger
*/
public function __construct( Config $config = null, LoggerInterface $logger = null ) {
$this->config = $config ?: RequestContext::getMain()->getConfig();
*/
public function __construct( Config $config = null, LoggerInterface $logger = null ) {
$this->config = $config ?: RequestContext::getMain()->getConfig();
/**
* Show the input form with optional error message
*
/**
* Show the input form with optional error message
*
- * @param string $err Error message or null if there's no error
+ * @param string|null $err Error message or null if there's no error
*/
function show( $err = null ) {
$out = $this->mContext->getOutput();
*/
function show( $err = null ) {
$out = $this->mContext->getOutput();
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to $user
* Revision::RAW get the text regardless of permissions
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to $user
* Revision::RAW get the text regardless of permissions
- * @param User $user User object to check for, only if FOR_THIS_USER is passed
+ * @param User|null $user User object to check for, only if FOR_THIS_USER is passed
* to the $audience parameter
* @since 1.21
* @return Content|null
* to the $audience parameter
* @since 1.21
* @return Content|null
* Retrieves a configuration setting for a given wiki.
* @param string $settingName ID of the setting name to retrieve
* @param string $wiki Wiki ID of the wiki in question.
* Retrieves a configuration setting for a given wiki.
* @param string $settingName ID of the setting name to retrieve
* @param string $wiki Wiki ID of the wiki in question.
- * @param string $suffix The suffix of the wiki in question.
+ * @param string|null $suffix The suffix of the wiki in question.
* @param array $params List of parameters. $.'key' is replaced by $value in all returned data.
* @param array $wikiTags The tags assigned to the wiki.
* @return mixed The value of the setting requested.
* @param array $params List of parameters. $.'key' is replaced by $value in all returned data.
* @param array $wikiTags The tags assigned to the wiki.
* @return mixed The value of the setting requested.
/**
* Gets all settings for a wiki
* @param string $wiki Wiki ID of the wiki in question.
/**
* Gets all settings for a wiki
* @param string $wiki Wiki ID of the wiki in question.
- * @param string $suffix The suffix of the wiki in question.
+ * @param string|null $suffix The suffix of the wiki in question.
* @param array $params List of parameters. $.'key' is replaced by $value in all returned data.
* @param array $wikiTags The tags assigned to the wiki.
* @return array Array of settings requested.
* @param array $params List of parameters. $.'key' is replaced by $value in all returned data.
* @param array $wikiTags The tags assigned to the wiki.
* @return array Array of settings requested.
* Retrieves a configuration setting for a given wiki, forced to a boolean.
* @param string $setting ID of the setting name to retrieve
* @param string $wiki Wiki ID of the wiki in question.
* Retrieves a configuration setting for a given wiki, forced to a boolean.
* @param string $setting ID of the setting name to retrieve
* @param string $wiki Wiki ID of the wiki in question.
- * @param string $suffix The suffix of the wiki in question.
+ * @param string|null $suffix The suffix of the wiki in question.
* @param array $wikiTags The tags assigned to the wiki.
* @return bool The value of the setting requested.
*/
* @param array $wikiTags The tags assigned to the wiki.
* @return bool The value of the setting requested.
*/
* Retrieves the value of a given setting, and places it in its corresponding global variable.
* @param string $setting ID of the setting name to retrieve
* @param string $wiki Wiki ID of the wiki in question.
* Retrieves the value of a given setting, and places it in its corresponding global variable.
* @param string $setting ID of the setting name to retrieve
* @param string $wiki Wiki ID of the wiki in question.
- * @param string $suffix The suffix of the wiki in question.
+ * @param string|null $suffix The suffix of the wiki in question.
* @param array $params List of parameters. $.'key' is replaced by $value in all returned data.
* @param array $wikiTags The tags assigned to the wiki.
*/
* @param array $params List of parameters. $.'key' is replaced by $value in all returned data.
* @param array $wikiTags The tags assigned to the wiki.
*/
/**
* Retrieves the values of all settings, and places them in their corresponding global variables.
* @param string $wiki Wiki ID of the wiki in question.
/**
* Retrieves the values of all settings, and places them in their corresponding global variables.
* @param string $wiki Wiki ID of the wiki in question.
- * @param string $suffix The suffix of the wiki in question.
+ * @param string|null $suffix The suffix of the wiki in question.
* @param array $params List of parameters. $.'key' is replaced by $value in all returned data.
* @param array $wikiTags The tags assigned to the wiki.
*/
* @param array $params List of parameters. $.'key' is replaced by $value in all returned data.
* @param array $wikiTags The tags assigned to the wiki.
*/
* @param string|bool $shortContext A short enclosing context message name, to
* be used when there is a single error
* @param string|bool $longContext A long enclosing context message name, for a list
* @param string|bool $shortContext A short enclosing context message name, to
* be used when there is a single error
* @param string|bool $longContext A long enclosing context message name, for a list
- * @param string|Language $lang Language to use for processing messages
+ * @param string|Language|null $lang Language to use for processing messages
* @return string
*/
public function getWikiText( $shortContext = false, $longContext = false, $lang = null ) {
* @return string
*/
public function getWikiText( $shortContext = false, $longContext = false, $lang = null ) {
*
* @param string|string[]|bool $shortContext A message name or an array of message names.
* @param string|string[]|bool $longContext A message name or an array of message names.
*
* @param string|string[]|bool $shortContext A message name or an array of message names.
* @param string|string[]|bool $longContext A message name or an array of message names.
- * @param string|Language $lang Language to use for processing messages
+ * @param string|Language|null $lang Language to use for processing messages
* @return Message
*/
public function getMessage( $shortContext = false, $longContext = false, $lang = null ) {
* @return Message
*/
public function getMessage( $shortContext = false, $longContext = false, $lang = null ) {
* If $error is an array, the "params" field is a list of parameters for the message.
*
* @param array|string $error Code string or (key: code string, params: string[]) map
* If $error is an array, the "params" field is a list of parameters for the message.
*
* @param array|string $error Code string or (key: code string, params: string[]) map
- * @param string|Language $lang Language to use for processing messages
+ * @param string|Language|null $lang Language to use for processing messages
* @return Message
*/
protected function getErrorMessage( $error, $lang = null ) {
* @return Message
*/
protected function getErrorMessage( $error, $lang = null ) {
/**
* Return an array with a Message object for each error.
* @param array $errors
/**
* Return an array with a Message object for each error.
* @param array $errors
- * @param string|Language $lang Language to use for processing messages
+ * @param string|Language|null $lang Language to use for processing messages
* @return Message[]
*/
protected function getErrorMessageArray( $errors, $lang = null ) {
* @return Message[]
*/
protected function getErrorMessageArray( $errors, $lang = null ) {
* @param JobQueueGroup $jobQueueGroup
* @param MessageCache $messageCache
* @param Language $contentLanguage
* @param JobQueueGroup $jobQueueGroup
* @param MessageCache $messageCache
* @param Language $contentLanguage
- * @param LoggerInterface $saveParseLogger
+ * @param LoggerInterface|null $saveParseLogger
*/
public function __construct(
WikiPage $wikiPage,
*/
public function __construct(
WikiPage $wikiPage,
* @param string $table
* @param string $idField
* @param string $nameField
* @param string $table
* @param string $idField
* @param string $nameField
- * @param callable $normalizationCallback Normalization to be applied to names before being
+ * @param callable|null $normalizationCallback Normalization to be applied to names before being
* saved or queried. This should be a callback that accepts and returns a single string.
* @param bool|string $wikiId The ID of the target wiki database. Use false for the local wiki.
* saved or queried. This should be a callback that accepts and returns a single string.
* @param bool|string $wikiId The ID of the target wiki database. Use false for the local wiki.
- * @param callable $insertCallback Callback to change insert fields accordingly.
+ * @param callable|null $insertCallback Callback to change insert fields accordingly.
* This parameter was introduced in 1.32
*/
public function __construct(
* This parameter was introduced in 1.32
*/
public function __construct(
* Use RevisionStore::getArchiveQueryInfo() to build a query that yields the
* required fields.
* @param int $queryFlags Flags for lazy loading behavior, see IDBAccessObject::READ_XXX.
* Use RevisionStore::getArchiveQueryInfo() to build a query that yields the
* required fields.
* @param int $queryFlags Flags for lazy loading behavior, see IDBAccessObject::READ_XXX.
+ * @param Title|null $title
* @param array $overrides An associative array that allows fields in $row to be overwritten.
* Keys in this array correspond to field names in $row without the "ar_" prefix, so
* $overrides['user'] will override $row->ar_user, etc.
* @param array $overrides An associative array that allows fields in $row to be overwritten.
* Keys in this array correspond to field names in $row without the "ar_" prefix, so
* $overrides['user'] will override $row->ar_user, etc.
* MCR migration note: this replaces Revision::getPrevious
*
* @param RevisionRecord $rev
* MCR migration note: this replaces Revision::getPrevious
*
* @param RevisionRecord $rev
- * @param Title $title if known (optional)
+ * @param Title|null $title if known (optional)
*
* @return RevisionRecord|null
*/
*
* @return RevisionRecord|null
*/
* MCR migration note: this replaces Revision::getNext
*
* @param RevisionRecord $rev
* MCR migration note: this replaces Revision::getNext
*
* @param RevisionRecord $rev
- * @param Title $title if known (optional)
+ * @param Title|null $title if known (optional)
*
* @return RevisionRecord|null
*/
*
* @return RevisionRecord|null
*/
*
* @param array $conditions
* @param int $flags (optional)
*
* @param array $conditions
* @param int $flags (optional)
+ * @param Title|null $title
*
* @return RevisionRecord|null
*/
*
* @return RevisionRecord|null
*/
* @param IDatabase $db
* @param array $conditions
* @param int $flags (optional)
* @param IDatabase $db
* @param array $conditions
* @param int $flags (optional)
+ * @param Title|null $title
*
* @return RevisionRecord|null
*/
*
* @return RevisionRecord|null
*/
* MCR migration note: this replaces Revision::getPrevious
*
* @param RevisionRecord $rev
* MCR migration note: this replaces Revision::getPrevious
*
* @param RevisionRecord $rev
- * @param Title $title if known (optional)
+ * @param Title|null $title if known (optional)
*
* @return RevisionRecord|null
*/
*
* @return RevisionRecord|null
*/
* MCR migration note: this replaces Revision::getNext
*
* @param RevisionRecord $rev
* MCR migration note: this replaces Revision::getNext
*
* @param RevisionRecord $rev
- * @param Title $title if known (optional)
+ * @param Title|null $title if known (optional)
*
* @return RevisionRecord|null
*/
*
* @return RevisionRecord|null
*/
- * @param string $global Name of the global variable.
- * @param string|callable $class Name of the class of the real object
+ * @param string|null $global Name of the global variable.
+ * @param string|callable|null $class Name of the class of the real object
* or a factory function to call
* @param array $params Parameters to pass to constructor of the real object.
*/
* or a factory function to call
* @param array $params Parameters to pass to constructor of the real object.
*/
protected $compileFlags = LightnCandy::FLAG_ERROR_EXCEPTION;
/**
protected $compileFlags = LightnCandy::FLAG_ERROR_EXCEPTION;
/**
- * @param string $templateDir
+ * @param string|null $templateDir
* @param bool $forceRecompile
*/
public function __construct( $templateDir = null, $forceRecompile = false ) {
* @param bool $forceRecompile
*/
public function __construct( $templateDir = null, $forceRecompile = false ) {
* May provide false positives, but should never provide a false negative.
*
* @param string $action Action that permission needs to be checked for
* May provide false positives, but should never provide a false negative.
*
* @param string $action Action that permission needs to be checked for
- * @param User $user User to check (since 1.19); $wgUser will be used if not provided.
+ * @param User|null $user User to check (since 1.19); $wgUser will be used if not provided.
* @return bool
*/
public function quickUserCan( $action, $user = null ) {
* @return bool
*/
public function quickUserCan( $action, $user = null ) {
* Can $user perform $action on this page?
*
* @param string $action Action that permission needs to be checked for
* Can $user perform $action on this page?
*
* @param string $action Action that permission needs to be checked for
- * @param User $user User to check (since 1.19); $wgUser will be used if not
+ * @param User|null $user User to check (since 1.19); $wgUser will be used if not
* provided.
* @param string $rigor Same format as Title::getUserPermissionsErrors()
* @return bool
* provided.
* @param string $rigor Same format as Title::getUserPermissionsErrors()
* @return bool
* Public for usage by LiquidThreads.
*
* @param array $rows Array of db result objects
* Public for usage by LiquidThreads.
*
* @param array $rows Array of db result objects
- * @param string $oldFashionedRestrictions Comma-separated set of permission keys
+ * @param string|null $oldFashionedRestrictions Comma-separated set of permission keys
* indicating who can move or edit the page from the page table, (pre 1.10) rows.
* Edit and move sections are separated by a colon
* Example: "edit=autoconfirmed,sysop:move=sysop"
* indicating who can move or edit the page from the page table, (pre 1.10) rows.
* Edit and move sections are separated by a colon
* Example: "edit=autoconfirmed,sysop:move=sysop"
/**
* Load restrictions from the page_restrictions table
*
/**
* Load restrictions from the page_restrictions table
*
- * @param string $oldFashionedRestrictions Comma-separated set of permission keys
+ * @param string|null $oldFashionedRestrictions Comma-separated set of permission keys
* indicating who can move or edit the page from the page table, (pre 1.10) rows.
* Edit and move sections are separated by a colon
* Example: "edit=autoconfirmed,sysop:move=sysop"
* indicating who can move or edit the page from the page table, (pre 1.10) rows.
* Edit and move sections are separated by a colon
* Example: "edit=autoconfirmed,sysop:move=sysop"
/**
* Updates page_touched for this page; called from LinksUpdate.php
*
/**
* Updates page_touched for this page; called from LinksUpdate.php
*
- * @param string $purgeTime [optional] TS_MW timestamp
+ * @param string|null $purgeTime [optional] TS_MW timestamp
* @return bool True if the update succeeded
*/
public function invalidateCache( $purgeTime = null ) {
* @return bool True if the update succeeded
*/
public function invalidateCache( $purgeTime = null ) {
/**
* Get the timestamp when this page was updated since the user last saw it.
*
/**
* Get the timestamp when this page was updated since the user last saw it.
*
+ * @param User|null $user
* @return string|null
*/
public function getNotificationTimestamp( $user = null ) {
* @return string|null
*/
public function getNotificationTimestamp( $user = null ) {
* If no source and no default, returns null.
*
* @param string $name
* If no source and no default, returns null.
*
* @param string $name
- * @param array $default Optional default (or null)
+ * @param array|null $default Optional default (or null)
* @return array|null
*/
public function getArray( $name, $default = null ) {
* @return array|null
*/
public function getArray( $name, $default = null ) {
* If an array is returned, contents are guaranteed to be integers.
*
* @param string $name
* If an array is returned, contents are guaranteed to be integers.
*
* @param string $name
- * @param array $default Option default (or null)
+ * @param array|null $default Option default (or null)
* @return array Array of ints
*/
public function getIntArray( $name, $default = null ) {
* @return array Array of ints
*/
public function getIntArray( $name, $default = null ) {
* Get a cookie from the $_COOKIE jar
*
* @param string $key The name of the cookie
* Get a cookie from the $_COOKIE jar
*
* @param string $key The name of the cookie
- * @param string $prefix A prefix to use for the cookie name, if not $wgCookiePrefix
- * @param mixed $default What to return if the value isn't found
+ * @param string|null $prefix A prefix to use for the cookie name, if not $wgCookiePrefix
+ * @param mixed|null $default What to return if the value isn't found
* @return mixed Cookie value or $default if the cookie not set
*/
public function getCookie( $key, $prefix = null, $default = null ) {
* @return mixed Cookie value or $default if the cookie not set
*/
public function getCookie( $key, $prefix = null, $default = null ) {
*
* @param string $wikiID Wiki'd id (generally database name)
* @param string $user User name (must be normalised before calling this function!)
*
* @param string $wikiID Wiki'd id (generally database name)
* @param string $user User name (must be normalised before calling this function!)
- * @param string $text Link's text; optional, default to "User:$user"
+ * @param string|null $text Link's text; optional, default to "User:$user"
* @return string HTML link or false if the wiki was not found
*/
public static function foreignUserLink( $wikiID, $user, $text = null ) {
* @return string HTML link or false if the wiki was not found
*/
public static function foreignUserLink( $wikiID, $user, $text = null ) {
*
* @param string $wikiID Wiki'd id (generally database name)
* @param string $page Page name (must be normalised before calling this function!)
*
* @param string $wikiID Wiki'd id (generally database name)
* @param string $page Page name (must be normalised before calling this function!)
- * @param string $text Link's text; optional, default to $page
+ * @param string|null $text Link's text; optional, default to $page
* @return string|false HTML link or false if the wiki was not found
*/
public static function makeForeignLink( $wikiID, $page, $text = null ) {
* @return string|false HTML link or false if the wiki was not found
*/
public static function makeForeignLink( $wikiID, $page, $text = null ) {
* characters (<, >, &) are escaped but illegals are not touched.
*
* @param string $element Element name
* characters (<, >, &) are escaped but illegals are not touched.
*
* @param string $element Element name
- * @param array $attribs Name=>value pairs. Values will be escaped.
+ * @param array|null $attribs Name=>value pairs. Values will be escaped.
* @param string $contents Null to make an open tag only; '' for a contentless closed tag (default)
* @param bool $allowShortTag Whether '' in $contents will result in a contentless closed tag
* @return string
* @param string $contents Null to make an open tag only; '' for a contentless closed tag (default)
* @param bool $allowShortTag Whether '' in $contents will result in a contentless closed tag
* @return string
* This opens an XML element
*
* @param string $element Name of the element
* This opens an XML element
*
* @param string $element Name of the element
- * @param array $attribs Array of attributes, see Xml::expandAttributes()
+ * @param array|null $attribs Array of attributes, see Xml::expandAttributes()
* @return string
*/
public static function openElement( $element, $attribs = null ) {
* @return string
*/
public static function openElement( $element, $attribs = null ) {
* Create a date selector
*
* @param string $selected The month which should be selected, default ''.
* Create a date selector
*
* @param string $selected The month which should be selected, default ''.
- * @param string $allmonths Value of a special item denoting all month.
+ * @param string|null $allmonths Value of a special item denoting all month.
* Null to not include (default).
* @param string $id Element identifier
* @return string Html string containing the month selector
* Null to not include (default).
* @param string $id Element identifier
* @return string Html string containing the month selector
*
* @param string $selected The language code of the selected language
* @param bool $customisedOnly If true only languages which have some content are listed
*
* @param string $selected The language code of the selected language
* @param bool $customisedOnly If true only languages which have some content are listed
- * @param string $inLanguage The ISO code of the language to display the select list in (optional)
+ * @param string|null $inLanguage The ISO code of the language to display the select list in
* @param array $overrideAttrs Override the attributes of the select tag (since 1.20)
* @param Message|null $msg Label message key (since 1.20)
* @return array Array containing 2 items: label HTML and select list HTML
* @param array $overrideAttrs Override the attributes of the select tag (since 1.20)
* @param Message|null $msg Label message key (since 1.20)
* @return array Array containing 2 items: label HTML and select list HTML
/**
* Convenience function to build an HTML drop-down list item.
* @param string $text Text for this item. Will be HTML escaped
/**
* Convenience function to build an HTML drop-down list item.
* @param string $text Text for this item. Will be HTML escaped
- * @param string $value Form submission value; if empty, use text
+ * @param string|null $value Form submission value; if empty, use text
* @param bool $selected If true, will be the default selected item
* @param array $attribs Optional additional HTML attributes
* @return string HTML
* @param bool $selected If true, will be the default selected item
* @param array $attribs Optional additional HTML attributes
* @return string HTML
* @param string $other Text for the "Other reasons" option
* @param string $selected Option which should be pre-selected
* @param string $class CSS classes for the drop-down
* @param string $other Text for the "Other reasons" option
* @param string $selected Option which should be pre-selected
* @param string $class CSS classes for the drop-down
- * @param int $tabindex Value of the tabindex attribute
+ * @param int|null $tabindex Value of the tabindex attribute
* @return string
*/
public static function listDropDown( $name = '', $list = '', $other = '',
* @return string
*/
public static function listDropDown( $name = '', $list = '', $other = '',
* @param array $fields Associative array, key is the name of a message that
* contains a description for the field, value is an HTML string
* containing the appropriate input.
* @param array $fields Associative array, key is the name of a message that
* contains a description for the field, value is an HTML string
* containing the appropriate input.
- * @param string $submitLabel The name of a message containing a label for
+ * @param string|null $submitLabel The name of a message containing a label for
* the submit button.
* @param array $submitAttribs The attributes to add to the submit button
* @return string HTML form.
* the submit button.
* @param array $submitAttribs The attributes to add to the submit button
* @return string HTML form.
* Build a table of data
* @param array $rows An array of arrays of strings, each to be a row in a table
* @param array $attribs An array of attributes to apply to the table tag [optional]
* Build a table of data
* @param array $rows An array of arrays of strings, each to be a row in a table
* @param array $attribs An array of attributes to apply to the table tag [optional]
- * @param array $headers An array of strings to use as table headers [optional]
+ * @param array|null $headers An array of strings to use as table headers [optional]
* @return string
*/
public static function buildTable( $rows, $attribs = [], $headers = null ) {
* @return string
*/
public static function buildTable( $rows, $attribs = [], $headers = null ) {
* Return true if we're to watch the page, false if not, null if no change.
* @param string $watchlist Valid values: 'watch', 'unwatch', 'preferences', 'nochange'
* @param Title $titleObj The page under consideration
* Return true if we're to watch the page, false if not, null if no change.
* @param string $watchlist Valid values: 'watch', 'unwatch', 'preferences', 'nochange'
* @param Title $titleObj The page under consideration
- * @param string $userOption The user option to consider when $watchlist=preferences.
+ * @param string|null $userOption The user option to consider when $watchlist=preferences.
* If not set will use watchdefault always and watchcreations if $titleObj doesn't exist.
* @return bool
*/
* If not set will use watchdefault always and watchcreations if $titleObj doesn't exist.
* @return bool
*/
* @param int &$value Parameter value
* @param int|null $min Minimum value
* @param int|null $max Maximum value for users
* @param int &$value Parameter value
* @param int|null $min Minimum value
* @param int|null $max Maximum value for users
- * @param int $botMax Maximum value for sysops/bots
+ * @param int|null $botMax Maximum value for sysops/bots
* @param bool $enforceLimits Whether to enforce (die) if value is outside limits
*/
protected function validateLimit( $paramName, &$value, $min, $max, $botMax = null,
* @param bool $enforceLimits Whether to enforce (die) if value is outside limits
*/
protected function validateLimit( $paramName, &$value, $min, $max, $botMax = null,
* Set a watch (or unwatch) based the based on a watchlist parameter.
* @param string $watch Valid values: 'watch', 'unwatch', 'preferences', 'nochange'
* @param Title $titleObj The article's title to change
* Set a watch (or unwatch) based the based on a watchlist parameter.
* @param string $watch Valid values: 'watch', 'unwatch', 'preferences', 'nochange'
* @param Title $titleObj The article's title to change
- * @param string $userOption The user option to consider when $watch=preferences
+ * @param string|null $userOption The user option to consider when $watch=preferences
*/
protected function setWatch( $watch, $titleObj, $userOption = null ) {
$value = $this->getWatchlistValue( $watch, $titleObj, $userOption );
*/
protected function setWatch( $watch, $titleObj, $userOption = null ) {
$value = $this->getWatchlistValue( $watch, $titleObj, $userOption );
* @since 1.25
* @param string|array|Message $msg
* @param IContextSource $context
* @since 1.25
* @param string|array|Message $msg
* @param IContextSource $context
+ * @param array|null $params
* @return Message|null
*/
public static function makeMessage( $msg, IContextSource $context, array $params = null ) {
* @return Message|null
*/
public static function makeMessage( $msg, IContextSource $context, array $params = null ) {
* @param Page $page Object to work on
* @param User $user User doing the action
* @param string $oldimage Archive name
* @param Page $page Object to work on
* @param User $user User doing the action
* @param string $oldimage Archive name
- * @param string &$reason Reason for the deletion. Autogenerated if null.
+ * @param string|null &$reason Reason for the deletion. Autogenerated if null.
* @param bool $suppress Whether to mark all deleted versions as restricted
* @param array $tags Tags to tag the deletion with
* @return Status
* @param bool $suppress Whether to mark all deleted versions as restricted
* @param array $tags Tags to tag the deletion with
* @return Status
/**
* Constructs an instance of ApiMain that utilizes the module and format specified by $request.
*
/**
* Constructs an instance of ApiMain that utilizes the module and format specified by $request.
*
- * @param IContextSource|WebRequest $context If this is an instance of
+ * @param IContextSource|WebRequest|null $context If this is an instance of
* FauxRequest, errors are thrown and no printing occurs
* @param bool $enableWrite Should be set to true if the api may modify data
*/
* FauxRequest, errors are thrown and no printing occurs
* @param bool $enableWrite Should be set to true if the api may modify data
*/
/**
* Log the preceding request
* @param float $time Time in seconds
/**
* Log the preceding request
* @param float $time Time in seconds
- * @param Exception $e Exception caught while processing the request
+ * @param Exception|null $e Exception caught while processing the request
*/
protected function logRequest( $time, $e = null ) {
$request = $this->getRequest();
*/
protected function logRequest( $time, $e = null ) {
$request = $this->getRequest();
* Get module instance by name, or instantiate it if it does not exist
*
* @param string $moduleName Module name
* Get module instance by name, or instantiate it if it does not exist
*
* @param string $moduleName Module name
- * @param string $group Optionally validate that the module is in a specific group
+ * @param string|null $group Optionally validate that the module is in a specific group
* @param bool $ignoreCache If true, force-creates a new instance and does not cache it
*
* @return ApiBase|null The new module instance, or null if failed
* @param bool $ignoreCache If true, force-creates a new instance and does not cache it
*
* @return ApiBase|null The new module instance, or null if failed
/**
* Get an array of modules in a specific group or all if no group is set.
/**
* Get an array of modules in a specific group or all if no group is set.
- * @param string $group Optional group filter
+ * @param string|null $group Optional group filter
* @return array List of module names
*/
public function getNames( $group = null ) {
* @return array List of module names
*/
public function getNames( $group = null ) {
/**
* Create an array of (moduleName => moduleClass) for a specific group or for all.
/**
* Create an array of (moduleName => moduleClass) for a specific group or for all.
- * @param string $group Name of the group to get or null for all
+ * @param string|null $group Name of the group to get or null for all
* @return array Name=>class map
*/
public function getNamesWithClasses( $group = null ) {
* @return array Name=>class map
*/
public function getNamesWithClasses( $group = null ) {
/**
* Returns true if the specific module is defined at all or in a specific group.
* @param string $moduleName Module name
/**
* Returns true if the specific module is defined at all or in a specific group.
* @param string $moduleName Module name
- * @param string $group Group name to check against, or null to check all groups,
+ * @param string|null $group Group name to check against, or null to check all groups,
* @return bool True if defined
*/
public function isDefined( $moduleName, $group = null ) {
* @return bool True if defined
*/
public function isDefined( $moduleName, $group = null ) {
/**
* Get a list of redirect resolutions - maps a title to its redirect
* target. Includes generator data for redirect source when available.
/**
* Get a list of redirect resolutions - maps a title to its redirect
* target. Includes generator data for redirect source when available.
- * @param ApiResult $result
+ * @param ApiResult|null $result
* @return array Array of prefixed_title (string) => Title object
* @since 1.21
*/
* @return array Array of prefixed_title (string) => Title object
* @since 1.21
*/
/**
* Get a list of title normalizations - maps a title to its normalized
* version in the form of result array.
/**
* Get a list of title normalizations - maps a title to its normalized
* version in the form of result array.
- * @param ApiResult $result
+ * @param ApiResult|null $result
* @return array Array of raw_prefixed_title (string) => prefixed_title (string)
* @since 1.21
*/
* @return array Array of raw_prefixed_title (string) => prefixed_title (string)
* @since 1.21
*/
/**
* Get a list of title conversions - maps a title to its converted
* version as a result array.
/**
* Get a list of title conversions - maps a title to its converted
* version as a result array.
- * @param ApiResult $result
+ * @param ApiResult|null $result
* @return array Array of (from, to) strings
* @since 1.21
*/
* @return array Array of (from, to) strings
* @since 1.21
*/
/**
* Get a list of interwiki titles - maps a title to its interwiki
* prefix as result.
/**
* Get a list of interwiki titles - maps a title to its interwiki
* prefix as result.
- * @param ApiResult $result
+ * @param ApiResult|null $result
* @param bool $iwUrl
* @return array Array of raw_prefixed_title (string) => interwiki_prefix (string)
* @since 1.21
* @param bool $iwUrl
* @return array Array of raw_prefixed_title (string) => interwiki_prefix (string)
* @since 1.21
/**
* Revision IDs that were not found in the database as result array.
/**
* Revision IDs that were not found in the database as result array.
- * @param ApiResult $result
+ * @param ApiResult|null $result
* @return array Array of revision IDs
* @since 1.21
*/
* @return array Array of revision IDs
* @since 1.21
*/
- * @param ApiPageSet $resultPageSet
+ * @param ApiPageSet|null $resultPageSet
* @return void
*/
protected function run( ApiPageSet $resultPageSet = null ) {
* @return void
*/
protected function run( ApiPageSet $resultPageSet = null ) {
- * @param ApiPageSet $resultPageSet
+ * @param ApiPageSet|null $resultPageSet
* @return void
*/
protected function run( ApiPageSet $resultPageSet = null ) {
* @return void
*/
protected function run( ApiPageSet $resultPageSet = null ) {
- * @param ApiPageSet $resultPageSet
+ * @param ApiPageSet|null $resultPageSet
*/
private function run( ApiPageSet $resultPageSet = null ) {
$settings = self::$settings[$this->getModuleName()];
*/
private function run( ApiPageSet $resultPageSet = null ) {
$settings = self::$settings[$this->getModuleName()];
* Add an option such as LIMIT or USE INDEX. If an option was set
* before, the old value will be overwritten
* @param string $name Option name
* Add an option such as LIMIT or USE INDEX. If an option was set
* before, the old value will be overwritten
* @param string $name Option name
- * @param string|string[] $value Option value
+ * @param string|string[]|null $value Option value
*/
protected function addOption( $name, $value = null ) {
if ( is_null( $value ) ) {
*/
protected function addOption( $name, $value = null ) {
if ( is_null( $value ) ) {
- * @param string $query
- * @param string $protocol
+ * @param string|null $query
+ * @param string|null $protocol
* @return null|string
*/
public function prepareUrlQuerySearchString( $query = null, $protocol = null ) {
* @return null|string
*/
public function prepareUrlQuerySearchString( $query = null, $protocol = null ) {
* Same as addPageSubItems(), but one element of $data at a time
* @param int $pageId Page ID
* @param array $item Data array à la ApiResult
* Same as addPageSubItems(), but one element of $data at a time
* @param int $pageId Page ID
* @param array $item Data array à la ApiResult
- * @param string $elemname XML element name. If null, getModuleName()
+ * @param string|null $elemname XML element name. If null, getModuleName()
* is used
* @return bool Whether the element fit in the result
*/
* is used
* @return bool Whether the element fit in the result
*/
- * @param ApiPageSet $resultPageSet
+ * @param ApiPageSet|null $resultPageSet
* @return void
*/
public function run( $resultPageSet = null ) {
* @return void
*/
public function run( $resultPageSet = null ) {
* @param File $file
* @param array $prop Array of properties to get (in the keys)
* @param ApiResult $result
* @param File $file
* @param array $prop Array of properties to get (in the keys)
* @param ApiResult $result
- * @param array $thumbParams Containing 'width' and 'height' items, or null
+ * @param array|null $thumbParams Containing 'width' and 'height' items, or null
* @param array|bool|string $opts Options for data fetching.
* This is an array consisting of the keys:
* 'version': The metadata version for the metadata option
* @param array|bool|string $opts Options for data fetching.
* This is an array consisting of the keys:
* 'version': The metadata version for the metadata option
- * @param ApiPageSet $resultPageSet
+ * @param ApiPageSet|null $resultPageSet
* @return void
*/
public function run( $resultPageSet = null ) {
* @return void
*/
public function run( $resultPageSet = null ) {
- * @param ApiPageSet $resultPageSet
+ * @param ApiPageSet|null $resultPageSet
*/
public function run( $resultPageSet = null ) {
$params = $this->extractRequestParams();
*/
public function run( $resultPageSet = null ) {
$params = $this->extractRequestParams();
/**
* Generates and outputs the result of this query based upon the provided parameters.
*
/**
* Generates and outputs the result of this query based upon the provided parameters.
*
- * @param ApiPageSet $resultPageSet
+ * @param ApiPageSet|null $resultPageSet
*/
public function run( $resultPageSet = null ) {
$user = $this->getUser();
*/
public function run( $resultPageSet = null ) {
$user = $this->getUser();
- * @param ApiPageSet $resultPageSet
+ * @param ApiPageSet|null $resultPageSet
* @return void
*/
abstract protected function run( ApiPageSet $resultPageSet = null );
* @return void
*/
abstract protected function run( ApiPageSet $resultPageSet = null );
* @since 1.25
* @param array &$arr
* @param string $type See ApiResult::META_TYPE
* @since 1.25
* @param array &$arr
* @param string $type See ApiResult::META_TYPE
- * @param string $kvpKeyName See ApiResult::META_KVP_KEY_NAME
+ * @param string|null $kvpKeyName See ApiResult::META_KVP_KEY_NAME
*/
public static function setArrayType( array &$arr, $type, $kvpKeyName = null ) {
if ( !in_array( $type, [
*/
public static function setArrayType( array &$arr, $type, $kvpKeyName = null ) {
if ( !in_array( $type, [
* @since 1.25
* @param array|string|null $path See ApiResult::addValue()
* @param string $tag See ApiResult::META_TYPE
* @since 1.25
* @param array|string|null $path See ApiResult::addValue()
* @param string $tag See ApiResult::META_TYPE
- * @param string $kvpKeyName See ApiResult::META_KVP_KEY_NAME
+ * @param string|null $kvpKeyName See ApiResult::META_KVP_KEY_NAME
*/
public function addArrayType( $path, $tag, $kvpKeyName = null ) {
$arr = &$this->path( $path );
*/
public function addArrayType( $path, $tag, $kvpKeyName = null ) {
$arr = &$this->path( $path );
* @since 1.25
* @param array &$arr
* @param string $type See ApiResult::META_TYPE
* @since 1.25
* @param array &$arr
* @param string $type See ApiResult::META_TYPE
- * @param string $kvpKeyName See ApiResult::META_KVP_KEY_NAME
+ * @param string|null $kvpKeyName See ApiResult::META_KVP_KEY_NAME
*/
public static function setArrayTypeRecursive( array &$arr, $type, $kvpKeyName = null ) {
self::setArrayType( $arr, $type, $kvpKeyName );
*/
public static function setArrayTypeRecursive( array &$arr, $type, $kvpKeyName = null ) {
self::setArrayType( $arr, $type, $kvpKeyName );
* @since 1.25
* @param array|string|null $path See ApiResult::addValue()
* @param string $tag See ApiResult::META_TYPE
* @since 1.25
* @param array|string|null $path See ApiResult::addValue()
* @param string $tag See ApiResult::META_TYPE
- * @param string $kvpKeyName See ApiResult::META_KVP_KEY_NAME
+ * @param string|null $kvpKeyName See ApiResult::META_KVP_KEY_NAME
*/
public function addArrayTypeRecursive( $path, $tag, $kvpKeyName = null ) {
$arr = &$this->path( $path );
*/
public function addArrayTypeRecursive( $path, $tag, $kvpKeyName = null ) {
$arr = &$this->path( $path );
*
* @since 1.25
* @param array|object $data
*
* @since 1.25
* @param array|object $data
- * @param array &$metadata Store metadata here, if provided
+ * @param array|null &$metadata Store metadata here, if provided
* @return array|object
*/
public static function stripMetadataNonRecursive( $data, &$metadata = null ) {
* @return array|object
*/
public static function stripMetadataNonRecursive( $data, &$metadata = null ) {
*
* @param string $username
* @param Status $status From $this->checkPasswordValidity()
*
* @param string $username
* @param Status $status From $this->checkPasswordValidity()
- * @param mixed $data Passed through to $this->getPasswordResetData()
+ * @param mixed|null $data Passed through to $this->getPasswordResetData()
*/
protected function setPasswordResetFlag( $username, Status $status, $data = null ) {
$reset = $this->getPasswordResetData( $username, $data );
*/
protected function setPasswordResetFlag( $username, Status $status, $data = null ) {
$reset = $this->getPasswordResetData( $username, $data );
* Fetch authentication data from the current session
* @protected For use by AuthenticationProviders
* @param string $key
* Fetch authentication data from the current session
* @protected For use by AuthenticationProviders
* @param string $key
- * @param mixed $default
+ * @param mixed|null $default
* @return mixed
*/
public function getAuthenticationSessionData( $key, $default = null ) {
* @return mixed
*/
public function getAuthenticationSessionData( $key, $default = null ) {
/**
* @param AuthenticationRequest[] $reqs AuthenticationRequests needed to continue
* @param string $redirectTarget URL
/**
* @param AuthenticationRequest[] $reqs AuthenticationRequests needed to continue
* @param string $redirectTarget URL
- * @param mixed $redirectApiData Data suitable for adding to an ApiResult
+ * @param mixed|null $redirectApiData Data suitable for adding to an ApiResult
* @return AuthenticationResponse
* @see AuthenticationResponse::REDIRECT
*/
* @return AuthenticationResponse
* @see AuthenticationResponse::REDIRECT
*/
protected $warningLimit;
/**
protected $warningLimit;
/**
- * @param array $conditions An array of arrays describing throttling conditions.
+ * @param array|null $conditions An array of arrays describing throttling conditions.
* Defaults to $wgPasswordAttemptThrottle. See documentation of that variable for format.
* @param array $params Parameters (all optional):
* - type: throttle type, used as a namespace for counters,
* Defaults to $wgPasswordAttemptThrottle. See documentation of that variable for format.
* @param array $params Parameters (all optional):
* - type: throttle type, used as a namespace for counters,
* in order to avoid link table inconsistency), which was later removed
* for performance on wikis with a high edit rate.
*
* in order to avoid link table inconsistency), which was later removed
* for performance on wikis with a high edit rate.
*
+ * @param bool|null $update
* @return bool
*/
public function forUpdate( $update = null ) {
* @return bool
*/
public function forUpdate( $update = null ) {
* @param int $id Page's ID
* @param LinkTarget $target
* @param int $len Text's length
* @param int $id Page's ID
* @param LinkTarget $target
* @param int $len Text's length
- * @param int $redir Whether the page is a redirect
+ * @param int|null $redir Whether the page is a redirect
* @param int $revision Latest revision's ID
* @param string|null $model Latest revision's content model ID
* @param string|null $lang Language code of the page, if not the content language
* @param int $revision Latest revision's ID
* @param string|null $model Latest revision's content model ID
* @param string|null $lang Language code of the page, if not the content language
- * @param ResourceLoader $rl
- * @param LoggerInterface $logger
+ * @param ResourceLoader|null $rl
+ * @param LoggerInterface|null $logger
*/
public function __construct( ResourceLoader $rl = null, LoggerInterface $logger = null ) {
$this->resourceloader = $rl;
*/
public function __construct( ResourceLoader $rl = null, LoggerInterface $logger = null ) {
$this->resourceloader = $rl;
* is disabled.
*
* @param string $code Language to which load messages
* is disabled.
*
* @param string $code Language to which load messages
- * @param int $mode Use MessageCache::FOR_UPDATE to skip process cache [optional]
+ * @param int|null $mode Use MessageCache::FOR_UPDATE to skip process cache [optional]
* @throws InvalidArgumentException
* @return bool
*/
* @throws InvalidArgumentException
* @return bool
*/
/**
* @param string $code
* @param array &$where List of wfDebug() comments
/**
* @param string $code
* @param array &$where List of wfDebug() comments
- * @param int $mode Use MessageCache::FOR_UPDATE to use DB_MASTER
+ * @param int|null $mode Use MessageCache::FOR_UPDATE to use DB_MASTER
* @return bool|string True on success or one of ("cantacquire", "disabled")
*/
protected function loadFromDBWithLock( $code, array &$where, $mode = null ) {
* @return bool|string True on success or one of ("cantacquire", "disabled")
*/
protected function loadFromDBWithLock( $code, array &$where, $mode = null ) {
* on-demand from the database later.
*
* @param string $code Language code
* on-demand from the database later.
*
* @param string $code Language code
- * @param int $mode Use MessageCache::FOR_UPDATE to skip process cache
+ * @param int|null $mode Use MessageCache::FOR_UPDATE to skip process cache
* @return array Loaded messages for storing in caches
*/
protected function loadFromDB( $code, $mode = null ) {
* @return array Loaded messages for storing in caches
*/
protected function loadFromDB( $code, $mode = null ) {
/**
* @param string $message
* @param bool $interface
/**
* @param string $message
* @param bool $interface
- * @param Language $language
- * @param Title $title
+ * @param Language|null $language
+ * @param Title|null $title
* @return string
*/
public function transform( $message, $interface = false, $language = null, $title = null ) {
* @return string
*/
public function transform( $message, $interface = false, $language = null, $title = null ) {
/**
* @param string $text
/**
* @param string $text
+ * @param Title|null $title
* @param bool $linestart Whether or not this is at the start of a line
* @param bool $interface Whether this is an interface message
* @param bool $linestart Whether or not this is at the start of a line
* @param bool $interface Whether this is an interface message
- * @param Language|string $language Language code
+ * @param Language|string|null $language Language code
* @return ParserOutput|string
*/
public function parse( $text, $title = null, $linestart = true,
* @return ParserOutput|string
*/
public function parse( $text, $title = null, $linestart = true,
/**
* @param Title $pageTitle Title instance of the categorized page
/**
* @param Title $pageTitle Title instance of the categorized page
- * @param Revision $revision Latest Revision instance of the categorized page
+ * @param Revision|null $revision Latest Revision instance of the categorized page
*
* @throws MWException
*/
*
* @throws MWException
*/
/**
* @param string $timestamp Timestamp of the recent change to occur in TS_MW format
* @param Title $categoryTitle Title of the category a page is being added to or removed from
/**
* @param string $timestamp Timestamp of the recent change to occur in TS_MW format
* @param Title $categoryTitle Title of the category a page is being added to or removed from
- * @param User $user User object of the user that made the change
+ * @param User|null $user User object of the user that made the change
* @param string $comment Change summary
* @param Title $pageTitle Title of the page that is being added or removed
* @param string $lastTimestamp Parent revision timestamp of this change in TS_MW format
* @param string $comment Change summary
* @param Title $pageTitle Title of the page that is being added or removed
* @param string $lastTimestamp Parent revision timestamp of this change in TS_MW format
*
* @param RecentChange &$rc Passed by reference
* @param bool $watched (default false)
*
* @param RecentChange &$rc Passed by reference
* @param bool $watched (default false)
- * @param int $linenumber (default null)
+ * @param int|null $linenumber (default null)
*
* @return string|bool
*/
*
* @return string|bool
*/
* bot edit, or unpatrolled edit. In English it typically contains "N", "m", "b", or "!".
*
* @param string $flag One key of $wgRecentChangesFlags
* bot edit, or unpatrolled edit. In English it typically contains "N", "m", "b", or "!".
*
* @param string $flag One key of $wgRecentChangesFlags
- * @param IContextSource $context
+ * @param IContextSource|null $context
* @return string HTML
*/
public static function flag( $flag, IContextSource $context = null ) {
* @return string HTML
*/
public static function flag( $flag, IContextSource $context = null ) {
*
* @param int $old Number of bytes
* @param int $new Number of bytes
*
* @param int $old Number of bytes
* @param int $new Number of bytes
- * @param IContextSource $context
+ * @param IContextSource|null $context
* @return string
*/
public static function showCharacterDifference( $old, $new, IContextSource $context = null ) {
* @return string
*/
public static function showCharacterDifference( $old, $new, IContextSource $context = null ) {
* Format the character difference of one or several changes.
*
* @param RecentChange $old
* Format the character difference of one or several changes.
*
* @param RecentChange $old
- * @param RecentChange $new Last change to use, if not provided, $old will be used
+ * @param RecentChange|null $new Last change to use, if not provided, $old will be used
* @return string HTML fragment
*/
public function formatCharacterDifference( RecentChange $old, RecentChange $new = null ) {
* @return string HTML fragment
*/
public function formatCharacterDifference( RecentChange $old, RecentChange $new = null ) {
* field of this revision, if it's marked as deleted.
* @param RCCacheEntry|RecentChange $rc
* @param int $field
* field of this revision, if it's marked as deleted.
* @param RCCacheEntry|RecentChange $rc
* @param int $field
- * @param User $user User object to check, or null to use $wgUser
+ * @param User|null $user User object to check, or null to use $wgUser
* @return bool
*/
public static function userCan( $rc, $field, User $user = null ) {
* @return bool
*/
public static function userCan( $rc, $field, User $user = null ) {
*
* @param RecentChange &$rc
* @param bool $watched
*
* @param RecentChange &$rc
* @param bool $watched
- * @param int $linenumber (default null)
+ * @param int|null $linenumber (default null)
*
* @param RecentChange &$rc Passed by reference
* @param bool $watched (default false)
*
* @param RecentChange &$rc Passed by reference
* @param bool $watched (default false)
- * @param int $linenumber (default null)
+ * @param int|null $linenumber (default null)
*
* @return string|bool
*/
*
* @return string|bool
*/
/**
* Notify all the feeds about the change.
/**
* Notify all the feeds about the change.
- * @param array $feeds Optional feeds to send to, defaults to $wgRCFeeds
+ * @param array|null $feeds Optional feeds to send to, defaults to $wgRCFeeds
*/
public function notifyRCFeeds( array $feeds = null ) {
global $wgRCFeeds;
*/
public function notifyRCFeeds( array $feeds = null ) {
global $wgRCFeeds;
*
* @param RecentChange|int $change RecentChange or corresponding rc_id
* @param bool $auto For automatic patrol
*
* @param RecentChange|int $change RecentChange or corresponding rc_id
* @param bool $auto For automatic patrol
- * @param string|string[] $tags Change tags to add to the patrol log entry
+ * @param string|string[]|null $tags Change tags to add to the patrol log entry
* ($user should be able to add the specified tags before this is called)
* @return array See doMarkPatrolled(), or null if $change is not an existing rc_id
*/
* ($user should be able to add the specified tags before this is called)
* @return array See doMarkPatrolled(), or null if $change is not an existing rc_id
*/
* 'markedaspatrollederror-noautopatrol' as errors
* @param User $user User object doing the action
* @param bool $auto For automatic patrol
* 'markedaspatrollederror-noautopatrol' as errors
* @param User $user User object doing the action
* @param bool $auto For automatic patrol
- * @param string|string[] $tags Change tags to add to the patrol log entry
+ * @param string|string[]|null $tags Change tags to add to the patrol log entry
* ($user should be able to add the specified tags before this is called)
* @return array Array of permissions errors, see Title::getUserPermissionsErrors()
*/
* ($user should be able to add the specified tags before this is called)
* @return array Array of permissions errors, see Title::getUserPermissionsErrors()
*/
*
* @param string $timestamp Timestamp of the recent change to occur
* @param Title $categoryTitle Title of the category a page is being added to or removed from
*
* @param string $timestamp Timestamp of the recent change to occur
* @param Title $categoryTitle Title of the category a page is being added to or removed from
- * @param User $user User object of the user that made the change
+ * @param User|null $user User object of the user that made the change
* @param string $comment Change summary
* @param Title $pageTitle Title of the page that is being added or removed
* @param int $oldRevId Parent revision ID of this change
* @param string $comment Change summary
* @param Title $pageTitle Title of the page that is being added or removed
* @param int $oldRevId Parent revision ID of this change
* @param bool $bot true, if the change was made by a bot
* @param string $ip IP address of the user, if the change was made anonymously
* @param int $deleted Indicates whether the change has been deleted
* @param bool $bot true, if the change was made by a bot
* @param string $ip IP address of the user, if the change was made anonymously
* @param int $deleted Indicates whether the change has been deleted
- * @param bool $added true, if the category was added, false for removed
+ * @param bool|null $added true, if the category was added, false for removed
*
* @return RecentChange
*/
*
* @return RecentChange
*/
* @param int|null $rc_id The rc_id of the change to add the tags to
* @param int|null $rev_id The rev_id of the change to add the tags to
* @param int|null $log_id The log_id of the change to add the tags to
* @param int|null $rc_id The rc_id of the change to add the tags to
* @param int|null $rev_id The rev_id of the change to add the tags to
* @param int|null $log_id The log_id of the change to add the tags to
- * @param string $params Params to put in the ct_params field of table 'change_tag'
+ * @param string|null $params Params to put in the ct_params field of table 'change_tag'
* @param RecentChange|null $rc Recent change, in case the tagging accompanies the action
* (this should normally be the case)
*
* @param RecentChange|null $rc Recent change, in case the tagging accompanies the action
* (this should normally be the case)
*
* Pass a variable whose value is null if the rev_id is not relevant or unknown.
* @param int|null &$log_id The log_id of the change to add the tags to.
* Pass a variable whose value is null if the log_id is not relevant or unknown.
* Pass a variable whose value is null if the rev_id is not relevant or unknown.
* @param int|null &$log_id The log_id of the change to add the tags to.
* Pass a variable whose value is null if the log_id is not relevant or unknown.
- * @param string $params Params to put in the ct_params field of table
+ * @param string|null $params Params to put in the ct_params field of table
* 'change_tag' when adding tags
* @param RecentChange|null $rc Recent change being tagged, in case the tagging accompanies
* the action
* 'change_tag' when adding tags
* @param RecentChange|null $rc Recent change being tagged, in case the tagging accompanies
* the action
* @param string $tag
* @param string $reason
* @param User $user Who to attribute the action to
* @param string $tag
* @param string $reason
* @param User $user Who to attribute the action to
- * @param int $tagCount For deletion only, how many usages the tag had before
+ * @param int|null $tagCount For deletion only, how many usages the tag had before
* it was deleted.
* @param array $logEntryTags Change tags to apply to the entry
* that will be created in the tag management log
* it was deleted.
* @param array $logEntryTags Change tags to apply to the entry
* that will be created in the tag management log
- * @param string $modelId
+ * @param string|null $modelId
- * @param string $format
+ * @param string|null $format
+ * @param Content|null $that
* @since 1.21
*
* @param Title $title
* @since 1.21
*
* @param Title $title
+ * @param Content|null $old
- * @param ParserOutput $parserOutput
+ * @param ParserOutput|null $parserOutput
*
* @return DataUpdate[]
*
*
* @return DataUpdate[]
*
* Returns the English language, because code is English, and should be handled as such.
*
* @param Title $title
* Returns the English language, because code is English, and should be handled as such.
*
* @param Title $title
- * @param Content $content
+ * @param Content|null $content
* Returns the English language, because code is English, and should be handled as such.
*
* @param Title $title
* Returns the English language, because code is English, and should be handled as such.
*
* @param Title $title
- * @param Content $content
+ * @param Content|null $content
- * @param string $format The desired serialization format, or null for the default format.
+ * @param string|null $format The desired serialization format, or null for the default format.
*
* @return string Serialized form of this Content object.
*/
*
* @return string Serialized form of this Content object.
*/
- * @param Content $that The Content object to compare to.
+ * @param Content|null $that The Content object to compare to.
*
* @return bool True if this Content object is equal to $that, false otherwise.
*/
*
* @return bool True if this Content object is equal to $that, false otherwise.
*/
* may call ParserOutput::recordOption() on the output object.
*
* @param Title $title The page title to use as a context for rendering.
* may call ParserOutput::recordOption() on the output object.
*
* @param Title $title The page title to use as a context for rendering.
- * @param int $revId Optional revision ID being rendered.
- * @param ParserOptions $options Any parser options.
+ * @param int|null $revId Optional revision ID being rendered.
+ * @param ParserOptions|null $options Any parser options.
* @param bool $generateHtml Whether to generate HTML (default: true). If false,
* the result of calling getText() on the ParserOutput object returned by
* this method is undefined.
* @param bool $generateHtml Whether to generate HTML (default: true). If false,
* the result of calling getText() on the ParserOutput object returned by
* this method is undefined.
* AbstractContent does.
*
* @param Title $title The context for determining the necessary updates
* AbstractContent does.
*
* @param Title $title The context for determining the necessary updates
- * @param Content $old An optional Content object representing the
+ * @param Content|null $old An optional Content object representing the
* previous content, i.e. the content being replaced by this Content
* object.
* @param bool $recursive Whether to include recursive updates (default:
* false).
* previous content, i.e. the content being replaced by this Content
* object.
* @param bool $recursive Whether to include recursive updates (default:
* false).
- * @param ParserOutput $parserOutput Optional ParserOutput object.
+ * @param ParserOutput|null $parserOutput Optional ParserOutput object.
* Provide if you have one handy, to avoid re-parsing of the content.
*
* @return DataUpdate[] A list of DataUpdate objects for putting information
* Provide if you have one handy, to avoid re-parsing of the content.
*
* @return DataUpdate[] A list of DataUpdate objects for putting information
- * @param Content $content
+ * @param Content|null $content
*
* @throws MWException If the content is not an instance of TextContent and
* wgContentHandlerTextFallback was set to 'fail'.
*
* @throws MWException If the content is not an instance of TextContent and
* wgContentHandlerTextFallback was set to 'fail'.
*
* @param string $text The textual representation, will be
* unserialized to create the Content object
*
* @param string $text The textual representation, will be
* unserialized to create the Content object
- * @param Title $title The title of the page this text belongs to.
+ * @param Title|null $title The title of the page this text belongs to.
* Required if $modelId is not provided.
* Required if $modelId is not provided.
- * @param string $modelId The model to deserialize to. If not provided,
+ * @param string|null $modelId The model to deserialize to. If not provided,
* $title->getContentModel() is used.
* $title->getContentModel() is used.
- * @param string $format The format to use for deserialization. If not
+ * @param string|null $format The format to use for deserialization. If not
* given, the model's default format is used.
*
* @throws MWException If model ID or format is not supported or if the text can not be
* given, the model's default format is used.
*
* @throws MWException If model ID or format is not supported or if the text can not be
* @since 1.21
*
* @param Content $content The Content object to serialize
* @since 1.21
*
* @param Content $content The Content object to serialize
- * @param string $format The desired serialization format
+ * @param string|null $format The desired serialization format
*
* @return string Serialized form of the content
*/
*
* @return string Serialized form of the content
*/
* @since 1.21
*
* @param string $blob Serialized form of the content
* @since 1.21
*
* @param string $blob Serialized form of the content
- * @param string $format The format used for serialization
+ * @param string|null $format The format used for serialization
*
* @return Content The Content object created by deserializing $blob
*/
*
* @return Content The Content object created by deserializing $blob
*/
* @since 1.21
*
* @param Title $title The page to determine the language for.
* @since 1.21
*
* @param Title $title The page to determine the language for.
- * @param Content $content The page's content, if you have it handy, to avoid reloading it.
+ * @param Content|null $content The page's content, if you have it handy, to avoid reloading it.
*
* @return Language The page's language
*/
*
* @return Language The page's language
*/
* @since 1.21
*
* @param Title $title The page to determine the language for.
* @since 1.21
*
* @param Title $title The page to determine the language for.
- * @param Content $content The page's content, if you have it handy, to avoid reloading it.
+ * @param Content|null $content The page's content, if you have it handy, to avoid reloading it.
*
* @return Language The page's language for viewing
*/
*
* @return Language The page's language for viewing
*/
* Specific content handlers may override it if they need different content handling.
*
* @param WikiPage $page
* Specific content handlers may override it if they need different content handling.
*
* @param WikiPage $page
- * @param ParserCache $cache
+ * @param ParserCache|null $cache
* @return ParserOutput
*/
public function getParserOutputForIndexing( WikiPage $page, ParserCache $cache = null ) {
* @return ParserOutput
*/
public function getParserOutputForIndexing( WikiPage $page, ParserCache $cache = null ) {
/**
* @param Message|string $msg A Message object, or a message key.
/**
* @param Message|string $msg A Message object, or a message key.
- * @param string[] $params An optional array of message parameters.
+ * @param string[]|null $params An optional array of message parameters.
*/
public function __construct( $msg, $params = null ) {
# XXX: messages may be wikitext, html or plain text! and maybe even something else entirely.
*/
public function __construct( $msg, $params = null ) {
# XXX: messages may be wikitext, html or plain text! and maybe even something else entirely.
/**
* @param Title $title Unused.
/**
* @param Title $title Unused.
- * @param int $revId Unused.
- * @param ParserOptions $options Unused.
+ * @param int|null $revId Unused.
+ * @param ParserOptions|null $options Unused.
* @param bool $generateHtml Whether to generate HTML (default: true).
*
* @return ParserOutput
* @param bool $generateHtml Whether to generate HTML (default: true).
*
* @return ParserOutput
* @since 1.21
*
* @param Content $that The other content object to compare this content object to.
* @since 1.21
*
* @param Content $that The other content object to compare this content object to.
- * @param Language $lang The language object to use for text segmentation.
+ * @param Language|null $lang The language object to use for text segmentation.
* If not given, $wgContentLang is used.
*
* @return Diff A diff representing the changes that would have to be
* If not given, $wgContentLang is used.
*
* @return Diff A diff representing the changes that would have to be
* Returns the content's text as-is.
*
* @param Content $content
* Returns the content's text as-is.
*
* @param Content $content
- * @param string $format The serialization format to check
+ * @param string|null $format The serialization format to check
* @since 1.21
*
* @param string $text Serialized form of the content
* @since 1.21
*
* @param string $text Serialized form of the content
- * @param string $format The format used for serialization
+ * @param string|null $format The format used for serialization
*
* @return Content The TextContent object wrapping $text
*/
*
* @return Content The TextContent object wrapping $text
*/
* @param IMaintainableDatabase $db A database subclass
* @param array $tablesToClone An array of tables to clone, unprefixed
* @param string $newTablePrefix Prefix to assign to the tables
* @param IMaintainableDatabase $db A database subclass
* @param array $tablesToClone An array of tables to clone, unprefixed
* @param string $newTablePrefix Prefix to assign to the tables
- * @param string $oldTablePrefix Prefix on current tables, if not $wgDBprefix
+ * @param string|null $oldTablePrefix Prefix on current tables, if not $wgDBprefix
* @param bool $dropCurrentTables
*/
public function __construct( IMaintainableDatabase $db, array $tablesToClone,
* @param bool $dropCurrentTables
*/
public function __construct( IMaintainableDatabase $db, array $tablesToClone,
*
* @param IDatabase $db
* @param string $name The script name (relative to $patchDir, without the '.sql' suffix)
*
* @param IDatabase $db
* @param string $name The script name (relative to $patchDir, without the '.sql' suffix)
- * @param string $patchDir The directory to find the script in. Use __DIR__ to search in the
+ * @param string|null $patchDir The directory to find the script in. Use __DIR__ to search in the
* directory the calling code is located in. If omitted, the "maintenance"
* directory will be used, where the scripts used by the updater are located.
*
* directory the calling code is located in. If omitted, the "maintenance"
* directory will be used, where the scripts used by the updater are located.
*
class LineFormatter extends MonologLineFormatter {
/**
class LineFormatter extends MonologLineFormatter {
/**
- * @param string $format The format of the message
- * @param string $dateFormat The format of the timestamp: one supported by DateTime::format
+ * @param string|null $format The format of the message
+ * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format
* @param bool $allowInlineLineBreaks Whether to allow inline line breaks in log entries
* @param bool $ignoreEmptyContextAndExtra
* @param bool $includeStacktraces
* @param bool $allowInlineLineBreaks Whether to allow inline line breaks in log entries
* @param bool $ignoreEmptyContextAndExtra
* @param bool $includeStacktraces
* If you're using a real search engine, you'll probably want to override
* this behavior and do something nicer with the original wikitext.
* @param string $text
* If you're using a real search engine, you'll probably want to override
* this behavior and do something nicer with the original wikitext.
* @param string $text
- * @param SearchEngine $se Search engine
+ * @param SearchEngine|null $se Search engine
* @return string
*/
public function updateText( $text, SearchEngine $se = null ) {
* @return string
*/
public function updateText( $text, SearchEngine $se = null ) {
* @return string[]|string|null
*/
public function getClosing( $i = null ) {
* @return string[]|string|null
*/
public function getClosing( $i = null ) {
- * @param IContextSource $context Context to use, anything else will be ignored
+ * @param IContextSource|null $context Context to use, anything else will be ignored
* @param int $old Old ID we want to show and diff with.
* @param string|int $new Either revision ID or 'prev' or 'next'. Default: 0.
* @param int $rcid Deprecated, no longer used!
* @param int $old Old ID we want to show and diff with.
* @param string|int $new Either revision ID or 'prev' or 'next'. Default: 0.
* @param int $rcid Deprecated, no longer used!
/**
* @param string|array|MessageSpecifier $messageSpec See Message::newFromSpecifier
* @param int $code
/**
* @param string|array|MessageSpecifier $messageSpec See Message::newFromSpecifier
* @param int $code
- * @param Exception|Throwable $previous The previous exception used for the exception chaining.
+ * @param Exception|Throwable|null $previous The previous exception used for the exception
+ * chaining.
*/
public function __construct( $messageSpec, $code = 0, $previous = null ) {
$this->messageSpec = $messageSpec;
*/
public function __construct( $messageSpec, $code = 0, $previous = null ) {
$this->messageSpec = $messageSpec;
*
* @param int $level Error level raised
* @param string $message
*
* @param int $level Error level raised
* @param string $message
- * @param string $file
- * @param int $line
+ * @param string|null $file
+ * @param int|null $line
* @return bool
*
* @see logError()
* @return bool
*
* @see logError()
- * @param int $level Error level raised
- * @param string $message Error message
- * @param string $file File that error was raised in
- * @param int $line Line number error was raised at
- * @param array $context Active symbol table point of error
- * @param array $trace Backtrace at point of error (undocumented HHVM
+ * @param int|null $level Error level raised
+ * @param string|null $message Error message
+ * @param string|null $file File that error was raised in
+ * @param int|null $line Line number error was raised at
+ * @param array|null $context Active symbol table point of error
+ * @param array|null $trace Backtrace at point of error (undocumented HHVM
* feature)
* @return bool Always returns false
*/
* feature)
* @return bool Always returns false
*/
/**
* @param string $command
/**
* @param string $command
+ * @param string|null $file
*/
function __construct( $command, $file = null ) {
if ( !is_null( $file ) ) {
*/
function __construct( $command, $file = null ) {
if ( !is_null( $file ) ) {
/**
* @param Title $title
* @param FileRepo $repo
/**
* @param Title $title
* @param FileRepo $repo
- * @param string|int $time
+ * @param string|int|null $time
* @return self
* @throws MWException
*/
* @return self
* @throws MWException
*/
* Build a new HTMLForm from an array of field attributes
*
* @param array $descriptor Array of Field constructs, as described above
* Build a new HTMLForm from an array of field attributes
*
* @param array $descriptor Array of Field constructs, as described above
- * @param IContextSource $context Available since 1.18, will become compulsory in 1.18.
+ * @param IContextSource|null $context Available since 1.18, will become compulsory in 1.18.
* Obviates the need to call $form->setTitle()
* @param string $messagePrefix A prefix to go in front of default messages
*/
* Obviates the need to call $form->setTitle()
* @param string $messagePrefix A prefix to go in front of default messages
*/
* @param string $url Url to use. If protocol-relative, will be expanded to an http:// URL
* @param array $options (optional) extra params to pass (see Http::request())
* @param string $caller The method making this request, for profiling
* @param string $url Url to use. If protocol-relative, will be expanded to an http:// URL
* @param array $options (optional) extra params to pass (see Http::request())
* @param string $caller The method making this request, for profiling
- * @param Profiler $profiler An instance of the profiler for profiling, or null
+ * @param Profiler|null $profiler An instance of the profiler for profiling, or null
*/
public function __construct(
$url, array $options = [], $caller = __METHOD__, $profiler = null
*/
public function __construct(
$url, array $options = [], $caller = __METHOD__, $profiler = null
/**
* @param string $siteName
/**
* @param string $siteName
+ * @param string|null $admin
* @param array $option
*/
function __construct( $siteName, $admin = null, array $option = [] ) {
* @param array $option
*/
function __construct( $siteName, $admin = null, array $option = [] ) {
/**
* @param Database &$db To perform updates on
* @param bool $shared Whether to perform updates on shared tables
/**
* @param Database &$db To perform updates on
* @param bool $shared Whether to perform updates on shared tables
- * @param Maintenance $maintenance Maintenance object which created us
+ * @param Maintenance|null $maintenance Maintenance object which created us
*/
protected function __construct( Database &$db, $shared, Maintenance $maintenance = null ) {
$this->db = $db;
*/
protected function __construct( Database &$db, $shared, Maintenance $maintenance = null ) {
$this->db = $db;
* Obviously, only use this for updates that occur after the updatelog table was
* created!
* @param string $key Name of key to insert
* Obviously, only use this for updates that occur after the updatelog table was
* created!
* @param string $key Name of key to insert
- * @param string $val [optional] Value to insert along with the key
+ * @param string|null $val [optional] Value to insert along with the key
*/
public function insertUpdateRow( $key, $val = null ) {
$this->db->clearFlag( DBO_DDLMODE );
*/
public function insertUpdateRow( $key, $val = null ) {
$this->db->clearFlag( DBO_DDLMODE );
*
* @param string $path Path to the patch file
* @param bool $isFullPath Whether to treat $path as a relative or not
*
* @param string $path Path to the patch file
* @param bool $isFullPath Whether to treat $path as a relative or not
- * @param string $msg Description of the patch
+ * @param string|null $msg Description of the patch
* @return bool False if patch is skipped.
*/
protected function applyPatch( $path, $isFullPath = false, $msg = null ) {
* @return bool False if patch is skipped.
*/
protected function applyPatch( $path, $isFullPath = false, $msg = null ) {
* Installer variables are typically prefixed by an underscore.
*
* @param string $name
* Installer variables are typically prefixed by an underscore.
*
* @param string $name
- * @param mixed $default
+ * @param mixed|null $default
* Get a session variable.
*
* @param string $name
* Get a session variable.
*
* @param string $name
- * @param array $default
+ * @param array|null $default
- * @param mixed $default
+ * @param mixed|null $default
/**
* Get the URL for a particular title (or with $1 if no title given)
*
/**
* Get the URL for a particular title (or with $1 if no title given)
*
- * @param string $title What text to put for the article name
+ * @param string|null $title What text to put for the article name
* @return string The URL
* @note Prior to 1.19 The getURL with an argument was broken.
* If you if you use this arg in an extension that supports MW earlier
* @return string The URL
* @note Prior to 1.19 The getURL with an argument was broken.
* If you if you use this arg in an extension that supports MW earlier
- * @param LoggerInterface $logger
+ * @param LoggerInterface|null $logger
*/
public function __construct( LoggerInterface $logger = null ) {
if ( $logger === null ) {
*/
public function __construct( LoggerInterface $logger = null ) {
if ( $logger === null ) {
* @param string $type
* @param array $params Map of key/values
* @param array $opts Map of key/values; includes 'removeDuplicates'
* @param string $type
* @param array $params Map of key/values
* @param array $opts Map of key/values; includes 'removeDuplicates'
- * @param Title $title Optional descriptive title
+ * @param Title|null $title Optional descriptive title
*/
public function __construct(
$type, array $params, array $opts = [], Title $title = null
*/
public function __construct(
$type, array $params, array $opts = [], Title $title = null
* not a big problem in practice, but there are test cases)
*
* @param string $domain The domain to validate
* not a big problem in practice, but there are test cases)
*
* @param string $domain The domain to validate
- * @param string $originDomain (optional) the domain the cookie originates from
+ * @param string|null $originDomain (optional) the domain the cookie originates from
* @return bool
*/
public static function validateCookieDomain( $domain, $originDomain = null ) {
* @return bool
*/
public static function validateCookieDomain( $domain, $originDomain = null ) {
/**
* Clear one or several cache entries, or all cache entries
*
/**
* Clear one or several cache entries, or all cache entries
*
- * @param string|array $keys
+ * @param string|array|null $keys
* @return void
*/
public function clear( $keys = null ) {
* @return void
*/
public function clear( $keys = null ) {
/**
* Clear one or several cache entries, or all cache entries.
*
/**
* Clear one or several cache entries, or all cache entries.
*
- * @param string|array $keys
+ * @param string|array|null $keys
* @return void
*/
public function clear( $keys = null ) {
* @return void
*/
public function clear( $keys = null ) {
/**
* Factory function for good results
*
/**
* Factory function for good results
*
+ * @param mixed|null $value
* @return static
*/
public static function newGood( $value = null ) {
* @return static
*/
public static function newGood( $value = null ) {
* Change operation result
*
* @param bool $ok Whether the operation completed
* Change operation result
*
* @param bool $ok Whether the operation completed
+ * @param mixed|null $value
*/
public function setResult( $ok, $value = null ) {
$this->ok = (bool)$ok;
*/
public function setResult( $ok, $value = null ) {
$this->ok = (bool)$ok;
- * @param string $markName The name of the mark that should
+ * @param string|null $markName The name of the mark that should
* be cleared. If not specified, all marks will be cleared.
*/
public function clearMarks( $markName = null ) {
* be cleared. If not specified, all marks will be cleared.
*/
public function clearMarks( $markName = null ) {
*
* @param string $measureName
* @param string $startMark
*
* @param string $measureName
* @param string $startMark
- * @param string $endMark
+ * @param string|null $endMark
* @return array|bool The measure that has been created, or false if either
* the start mark or the end mark do not exist.
*/
* @return array|bool The measure that has been created, or false if either
* the start mark or the end mark do not exist.
*/
*
* @see FileBackend::getFileStat()
*
*
* @see FileBackend::getFileStat()
*
- * @param array $paths Storage paths (optional)
+ * @param array|null $paths Storage paths (optional)
*/
abstract public function clearCache( array $paths = null );
*/
abstract public function clearCache( array $paths = null );
*
* @see FileBackend::clearCache()
*
*
* @see FileBackend::clearCache()
*
- * @param array $paths Storage paths (optional)
+ * @param array|null $paths Storage paths (optional)
*/
protected function doClearCache( array $paths = null ) {
}
*/
protected function doClearCache( array $paths = null ) {
}
/**
* @param array $creds From getAuthentication()
/**
* @param array $creds From getAuthentication()
- * @param string $container
- * @param string $object
+ * @param string|null $container
+ * @param string|null $object
* @return string
*/
protected function storageUrl( array $creds, $container = null, $object = null ) {
* @return string
*/
protected function storageUrl( array $creds, $container = null, $object = null ) {
* Get an array of file change log entries.
* A starting change ID and/or limit can be specified.
*
* Get an array of file change log entries.
* A starting change ID and/or limit can be specified.
*
- * @param int $start Starting change ID or null
+ * @param int|null $start Starting change ID or null
* @param int $limit Maximum number of items to return
* @param int $limit Maximum number of items to return
- * @param string &$next Updated to the ID of the next entry.
+ * @param string|null &$next Updated to the ID of the next entry.
* @return array List of associative arrays, each having:
* id : unique, monotonic, ID for this change
* batch_uuid : UUID for an operation batch
* @return array List of associative arrays, each having:
* id : unique, monotonic, ID for this change
* batch_uuid : UUID for an operation batch
* This is useful for early release of locks before function scope is destroyed.
* This is the same as setting the lock object to null.
*
* This is useful for early release of locks before function scope is destroyed.
* This is the same as setting the lock object to null.
*
- * @param ScopedLock &$lock
+ * @param ScopedLock|null &$lock
* @since 1.21
*/
public static function release( ScopedLock &$lock = null ) {
* @since 1.21
*/
public static function release( ScopedLock &$lock = null ) {
* @todo analyse file if need be
* @todo look at multiple extension, separately and together.
*
* @todo analyse file if need be
* @todo look at multiple extension, separately and together.
*
- * @param string $path Full path to the image file, in case we have to look at the contents
+ * @param string|null $path Full path to the image file, in case we have to look at the contents
* (if null, only the MIME type is used to determine the media type code).
* (if null, only the MIME type is used to determine the media type code).
- * @param string $mime MIME type. If null it will be guessed using guessMimeType.
+ * @param string|null $mime MIME type. If null it will be guessed using guessMimeType.
*
* @return string A value to be used with the MEDIATYPE_xxx constants.
*/
*
* @return string A value to be used with the MEDIATYPE_xxx constants.
*/
* result stored in $this->filterMatchType.
*
* @param string $input a filename or string containing the XML element
* result stored in $this->filterMatchType.
*
* @param string $input a filename or string containing the XML element
- * @param callable $filterCallback (optional)
+ * @param callable|null $filterCallback (optional)
* Function to call to do additional custom validity checks from the
* SAX element handler event. This gives you access to the element
* namespace, name, attributes, and text contents.
* Function to call to do additional custom validity checks from the
* SAX element handler event. This gives you access to the element
* namespace, name, attributes, and text contents.
* Alternative constructor: from filename
*
* @param string $fname the filename of an XML document
* Alternative constructor: from filename
*
* @param string $fname the filename of an XML document
- * @param callable $filterCallback (optional)
+ * @param callable|null $filterCallback (optional)
* Function to call to do additional custom validity checks from the
* SAX element handler event. This gives you access to the element
* namespace, name, and attributes, but not to text contents.
* Function to call to do additional custom validity checks from the
* SAX element handler event. This gives you access to the element
* namespace, name, and attributes, but not to text contents.
* Alternative constructor: from string
*
* @param string $string a string containing an XML element
* Alternative constructor: from string
*
* @param string $string a string containing an XML element
- * @param callable $filterCallback (optional)
+ * @param callable|null $filterCallback (optional)
* Function to call to do additional custom validity checks from the
* SAX element handler event. This gives you access to the element
* namespace, name, and attributes, but not to text contents.
* Function to call to do additional custom validity checks from the
* SAX element handler event. This gives you access to the element
* namespace, name, and attributes, but not to text contents.
*
* @param string $key
* @param int $flags Bitfield of BagOStuff::READ_* constants [optional]
*
* @param string $key
* @param int $flags Bitfield of BagOStuff::READ_* constants [optional]
- * @param int $oldFlags [unused]
+ * @param int|null $oldFlags [unused]
* @return mixed Returns false on failure and if the item does not exist
*/
public function get( $key, $flags = 0, $oldFlags = null ) {
* @return mixed Returns false on failure and if the item does not exist
*/
public function get( $key, $flags = 0, $oldFlags = null ) {
*
* @since 1.27
* @param string $class Key class
*
* @since 1.27
* @param string $class Key class
- * @param string $component [optional] Key component (starting with a key collection name)
+ * @param string|null $component [optional] Key component (starting with a key collection name)
* @return string Colon-delimited list of $keyspace followed by escaped components of $args
*/
public function makeGlobalKey( $class, $component = null ) {
* @return string Colon-delimited list of $keyspace followed by escaped components of $args
*/
public function makeGlobalKey( $class, $component = null ) {
*
* @since 1.27
* @param string $class Key class
*
* @since 1.27
* @param string $class Key class
- * @param string $component [optional] Key component (starting with a key collection name)
+ * @param string|null $component [optional] Key component (starting with a key collection name)
* @return string Colon-delimited list of $keyspace followed by escaped components of $args
*/
public function makeKey( $class, $component = null ) {
* @return string Colon-delimited list of $keyspace followed by escaped components of $args
*/
public function makeKey( $class, $component = null ) {
* That method has cache slam avoiding features for hot/expensive keys.
*
* @param string $key Cache key made from makeKey() or makeGlobalKey()
* That method has cache slam avoiding features for hot/expensive keys.
*
* @param string $key Cache key made from makeKey() or makeGlobalKey()
- * @param mixed &$curTTL Approximate TTL left on the key if present/tombstoned [returned]
+ * @param mixed|null &$curTTL Approximate TTL left on the key if present/tombstoned [returned]
* @param array $checkKeys List of "check" keys
* @param array $checkKeys List of "check" keys
- * @param float &$asOf UNIX timestamp of cached value; null on failure [returned]
+ * @param float|null &$asOf UNIX timestamp of cached value; null on failure [returned]
* @return mixed Value of cache key or false on failure
*/
final public function get( $key, &$curTTL = null, array $checkKeys = [], &$asOf = null ) {
* @return mixed Value of cache key or false on failure
*/
final public function get( $key, &$curTTL = null, array $checkKeys = [], &$asOf = null ) {
* @param int $ttl
* @param callback $callback
* @param array $opts Options map for getWithSetCallback()
* @param int $ttl
* @param callback $callback
* @param array $opts Options map for getWithSetCallback()
- * @param float &$asOf Cache generation timestamp of returned value [returned]
+ * @param float|null &$asOf Cache generation timestamp of returned value [returned]
* @return mixed
* @note Callable type hints are not used to avoid class-autoloading
*/
* @return mixed
* @note Callable type hints are not used to avoid class-autoloading
*/
/**
* @see BagOStuff::makeKey()
* @param string $class Key class
/**
* @see BagOStuff::makeKey()
* @param string $class Key class
- * @param string $component [optional] Key component (starting with a key collection name)
+ * @param string|null $component [optional] Key component (starting with a key collection name)
* @return string Colon-delimited list of $keyspace followed by escaped components of $args
* @since 1.27
*/
* @return string Colon-delimited list of $keyspace followed by escaped components of $args
* @since 1.27
*/
/**
* @see BagOStuff::makeGlobalKey()
* @param string $class Key class
/**
* @see BagOStuff::makeGlobalKey()
* @param string $class Key class
- * @param string $component [optional] Key component (starting with a key collection name)
+ * @param string|null $component [optional] Key component (starting with a key collection name)
* @return string Colon-delimited list of $keyspace followed by escaped components of $args
* @since 1.27
*/
* @return string Colon-delimited list of $keyspace followed by escaped components of $args
* @since 1.27
*/
* @see WANObjectCache::getWithSetCallback()
*
* @param IDatabase $db1
* @see WANObjectCache::getWithSetCallback()
*
* @param IDatabase $db1
- * @param IDatabase $db2 [optional]
+ * @param IDatabase|null $db2 [optional]
* @return array Map of values:
* - lag: highest lag of any of the DBs or false on error (e.g. replication stopped)
* - since: oldest UNIX timestamp of any of the DB lag estimates
* @return array Map of values:
* - lag: highest lag of any of the DBs or false on error (e.g. replication stopped)
* - since: oldest UNIX timestamp of any of the DB lag estimates
/**
* Returns the text of the error message from previous MySQL operation
*
/**
* Returns the text of the error message from previous MySQL operation
*
- * @param resource $conn Raw connection
+ * @param resource|null $conn Raw connection
* @return string
*/
abstract protected function mysqlError( $conn = null );
* @return string
*/
abstract protected function mysqlError( $conn = null );
/**
* List all tables on the database
*
/**
* List all tables on the database
*
- * @param string $prefix Only show tables with this prefix, e.g. mw_
+ * @param string|null $prefix Only show tables with this prefix, e.g. mw_
* @param string $fname Calling function name
* @return array
*/
* @param string $fname Calling function name
* @return array
*/
/**
* Lists VIEWs in the database
*
/**
* Lists VIEWs in the database
*
- * @param string $prefix Only show VIEWs with this prefix, eg.
+ * @param string|null $prefix Only show VIEWs with this prefix, eg.
* unit_test_, or $wgDBprefix. Default: null, would return all views.
* @param string $fname Name of calling function
* @return array
* unit_test_, or $wgDBprefix. Default: null, would return all views.
* @param string $fname Name of calling function
* @return array
* Differentiates between a TABLE and a VIEW.
*
* @param string $name Name of the TABLE/VIEW to test
* Differentiates between a TABLE and a VIEW.
*
* @param string $name Name of the TABLE/VIEW to test
- * @param string $prefix
+ * @param string|null $prefix
* @return bool
* @since 1.22
*/
* @return bool
* @since 1.22
*/
- * @param mysqli $conn Optional connection object
+ * @param mysqli|null $conn Optional connection object
* @return string
*/
protected function mysqlError( $conn = null ) {
* @return string
*/
protected function mysqlError( $conn = null ) {
/**
* List all tables on the database
*
/**
* List all tables on the database
*
- * @param string $prefix Only show tables with this prefix, e.g. mw_
+ * @param string|null $prefix Only show tables with this prefix, e.g. mw_
* @param string $fname Calling function name
*
* @return array
* @param string $fname Calling function name
*
* @return array
/**
* Get/set the table prefix.
/**
* Get/set the table prefix.
- * @param string $prefix The table prefix to set, or omitted to leave it unchanged.
+ * @param string|null $prefix The table prefix to set, or omitted to leave it unchanged.
* @return string The previous table prefix.
*/
public function tablePrefix( $prefix = null );
/**
* Get/set the db schema.
* @return string The previous table prefix.
*/
public function tablePrefix( $prefix = null );
/**
* Get/set the db schema.
- * @param string $schema The database schema to set, or omitted to leave it unchanged.
+ * @param string|null $schema The database schema to set, or omitted to leave it unchanged.
* @return string The previous db schema.
*/
public function dbSchema( $schema = null );
* @return string The previous db schema.
*/
public function dbSchema( $schema = null );
* Get properties passed down from the server info array of the load
* balancer.
*
* Get properties passed down from the server info array of the load
* balancer.
*
- * @param string $name The entry of the info array to get, or null to get the
+ * @param string|null $name The entry of the info array to get, or null to get the
* whole array
*
* @return array|mixed|null
* whole array
*
* @return array|mixed|null
* parameters, the member with the given name is set to the given value.
*
* @param string $name
* parameters, the member with the given name is set to the given value.
*
* @param string $name
+ * @param array|null $value
*/
public function setLBInfo( $name, $value = null );
*/
public function setLBInfo( $name, $value = null );
* @since 1.31
* @see IDatabase::startAtomic
* @param string $fname
* @since 1.31
* @see IDatabase::startAtomic
* @param string $fname
- * @param AtomicSectionIdentifier $sectionId Section ID from startAtomic();
+ * @param AtomicSectionIdentifier|null $sectionId Section ID from startAtomic();
* passing this enables cancellation of unclosed nested sections [optional]
* @throws DBError
*/
* passing this enables cancellation of unclosed nested sections [optional]
* @throws DBError
*/
* The result is unquoted, and needs to be passed through addQuotes()
* before it can be included in raw SQL.
*
* The result is unquoted, and needs to be passed through addQuotes()
* before it can be included in raw SQL.
*
- * @param string|int $ts
+ * @param string|int|null $ts
/**
* Lists all the VIEWs in the database
*
/**
* Lists all the VIEWs in the database
*
- * @param string $prefix Only show VIEWs with this prefix, eg. unit_test_
+ * @param string|null $prefix Only show VIEWs with this prefix, eg. unit_test_
* @param string $fname Name of calling function
* @throws RuntimeException
* @return array
* @param string $fname Name of calling function
* @throws RuntimeException
* @return array
/**
* List all tables on the database
*
/**
* List all tables on the database
*
- * @param string $prefix Only show tables with this prefix, e.g. mw_
+ * @param string|null $prefix Only show tables with this prefix, e.g. mw_
* @param string $fname Calling function name
* @throws DBError
* @return array
* @param string $fname Calling function name
* @throws DBError
* @return array
*/
class DBConnectionError extends DBExpectedError {
/**
*/
class DBConnectionError extends DBExpectedError {
/**
- * @param IDatabase $db Object throwing the error
+ * @param IDatabase|null $db Object throwing the error
* @param string $error Error text
*/
public function __construct( IDatabase $db = null, $error = 'unknown error' ) {
* @param string $error Error text
*/
public function __construct( IDatabase $db = null, $error = 'unknown error' ) {
/**
* Construct a database error
/**
* Construct a database error
- * @param IDatabase $db Object which threw the error
+ * @param IDatabase|null $db Object which threw the error
* @param string $error A simple error message to be used for debugging
* @param \Exception|\Throwable|null $prev Previous exception
*/
* @param string $error A simple error message to be used for debugging
* @param \Exception|\Throwable|null $prev Previous exception
*/
* @param int|string $errno
* @param string $sql
* @param string $fname
* @param int|string $errno
* @param string $sql
* @param string $fname
- * @param string $message Optional message, intended for subclases (optional)
+ * @param string|null $message Optional message, intended for subclases (optional)
*/
public function __construct( IDatabase $db, $error, $errno, $sql, $fname, $message = null ) {
if ( $message === null ) {
*/
public function __construct( IDatabase $db, $error, $errno, $sql, $fname, $message = null ) {
if ( $message === null ) {
/**
* Determine if any master connection has pending/written changes from this request
/**
* Determine if any master connection has pending/written changes from this request
- * @param float $age How many seconds ago is "recent" [defaults to LB lag wait timeout]
+ * @param float|null $age How many seconds ago is "recent" [defaults to LB lag wait timeout]
* @return bool
*/
public function hasOrMadeRecentMasterChanges( $age = null );
* @return bool
*/
public function hasOrMadeRecentMasterChanges( $age = null );
* This can be used a faster proxy for waitForAll()
*
* @param DBMasterPos|bool $pos Master position or false
* This can be used a faster proxy for waitForAll()
*
* @param DBMasterPos|bool $pos Master position or false
- * @param int $timeout Max seconds to wait; default is mWaitTimeout
+ * @param int|null $timeout Max seconds to wait; default is mWaitTimeout
* @return bool Success (able to connect and no timeouts reached)
*/
public function waitForOne( $pos, $timeout = null );
* @return bool Success (able to connect and no timeouts reached)
*/
public function waitForOne( $pos, $timeout = null );
* Set the master wait position and wait for ALL replica DBs to catch up to it
*
* @param DBMasterPos|bool $pos Master position or false
* Set the master wait position and wait for ALL replica DBs to catch up to it
*
* @param DBMasterPos|bool $pos Master position or false
- * @param int $timeout Max seconds to wait; default is mWaitTimeout
+ * @param int|null $timeout Max seconds to wait; default is mWaitTimeout
* @return bool Success (able to connect and no timeouts reached)
*/
public function waitForAll( $pos, $timeout = null );
* @return bool Success (able to connect and no timeouts reached)
*/
public function waitForAll( $pos, $timeout = null );
* Check if this load balancer object had any recent or still
* pending writes issued against it by this PHP thread
*
* Check if this load balancer object had any recent or still
* pending writes issued against it by this PHP thread
*
- * @param float $age How many seconds ago is "recent" [defaults to mWaitTimeout]
+ * @param float|null $age How many seconds ago is "recent" [defaults to mWaitTimeout]
* @return bool
*/
public function hasOrMadeRecentMasterChanges( $age = null );
* @return bool
*/
public function hasOrMadeRecentMasterChanges( $age = null );
* Wait for a given replica DB to catch up to the master pos stored in $this
* @param int $index Server index
* @param bool $open Check the server even if a new connection has to be made
* Wait for a given replica DB to catch up to the master pos stored in $this
* @param int $index Server index
* @param bool $open Check the server even if a new connection has to be made
- * @param int $timeout Max seconds to wait; default is "waitTimeout" given to __construct()
+ * @param int|null $timeout Max seconds to wait; default is "waitTimeout" given to __construct()
* @return bool
*/
protected function doWait( $index, $open = false, $timeout = null ) {
* @return bool
*/
protected function doWait( $index, $open = false, $timeout = null ) {
* See: https://github.com/phpredis/phpredis#scan
*
* @param int &$iterator
* See: https://github.com/phpredis/phpredis#scan
*
* @param int &$iterator
- * @param string $pattern
- * @param int $count
+ * @param string|null $pattern
+ * @param int|null $count
* @return array $res
*/
public function scan( &$iterator, $pattern = null, $count = null ) {
* @return array $res
*/
public function scan( &$iterator, $pattern = null, $count = null ) {
*
* @param string $key
* @param int &$iterator
*
* @param string $key
* @param int &$iterator
- * @param string $pattern
- * @param int $count
+ * @param string|null $pattern
+ * @param int|null $count
* @return array $res
*/
public function sScan( $key, &$iterator, $pattern = null, $count = null ) {
* @return array $res
*/
public function sScan( $key, &$iterator, $pattern = null, $count = null ) {
*
* @param string $key
* @param int &$iterator
*
* @param string $key
* @param int &$iterator
- * @param string $pattern
- * @param int $count
+ * @param string|null $pattern
+ * @param int|null $count
* @return array $res
*/
public function hScan( $key, &$iterator, $pattern = null, $count = null ) {
* @return array $res
*/
public function hScan( $key, &$iterator, $pattern = null, $count = null ) {
*
* @param string $key
* @param int &$iterator
*
* @param string $key
* @param int &$iterator
- * @param string $pattern
- * @param int $count
+ * @param string|null $pattern
+ * @param int|null $count
* @return array $res
*/
public function zScan( $key, &$iterator, $pattern = null, $count = null ) {
* @return array $res
*/
public function zScan( $key, &$iterator, $pattern = null, $count = null ) {
*
* @param string $server A hostname/port combination or the absolute path of a UNIX socket.
* If a hostname is specified but no port, port 6379 will be used.
*
* @param string $server A hostname/port combination or the absolute path of a UNIX socket.
* If a hostname is specified but no port, port 6379 will be used.
- * @param LoggerInterface $logger PSR-3 logger intance. [optional]
+ * @param LoggerInterface|null $logger PSR-3 logger intance. [optional]
* @return RedisConnRef|bool Returns false on failure
* @throws MWException
*/
* @return RedisConnRef|bool Returns false on failure
* @throws MWException
*/
* Adjust or reset the connection handle read timeout value
*
* @param Redis $conn
* Adjust or reset the connection handle read timeout value
*
* @param Redis $conn
- * @param int $timeout Optional
+ * @param int|null $timeout Optional
*/
public function resetTimeout( Redis $conn, $timeout = null ) {
$conn->setOption( Redis::OPT_READ_TIMEOUT, $timeout ?: $this->readTimeout );
*/
public function resetTimeout( Redis $conn, $timeout = null ) {
$conn->setOption( Redis::OPT_READ_TIMEOUT, $timeout ?: $this->readTimeout );
/**
* Insert the entry into the `logging` table.
*
/**
* Insert the entry into the `logging` table.
*
- * @param IDatabase $dbw
+ * @param IDatabase|null $dbw
* @return int ID of the log entry
* @throws MWException
*/
* @return int ID of the log entry
* @throws MWException
*/
* @param int|string $year Use 0 to start with no year preselected.
* @param int|string $month A month in the 1..12 range. Use 0 to start with no month
* preselected.
* @param int|string $year Use 0 to start with no year preselected.
* @param int|string $month A month in the 1..12 range. Use 0 to start with no month
* preselected.
+ * @param array|null $filter
* @param string $tagFilter Tag to select by default
* @param string $tagFilter Tag to select by default
- * @param string $action
+ * @param string|null $action
*/
public function showOptions( $types = [], $user = '', $page = '', $pattern = false, $year = 0,
$month = 0, $filter = null, $tagFilter = '', $action = null
*/
public function showOptions( $types = [], $user = '', $page = '', $pattern = false, $year = 0,
$month = 0, $filter = null, $tagFilter = '', $action = null
*
* @param stdClass $row
* @param int $field
*
* @param stdClass $row
* @param int $field
- * @param User $user User to check, or null to use $wgUser
+ * @param User|null $user User to check, or null to use $wgUser
* @return bool
*/
public static function userCan( $row, $field, User $user = null ) {
* @return bool
*/
public static function userCan( $row, $field, User $user = null ) {
*
* @param int $bitfield Current field
* @param int $field
*
* @param int $bitfield Current field
* @param int $field
- * @param User $user User to check, or null to use $wgUser
+ * @param User|null $user User to check, or null to use $wgUser
* @return bool
*/
public static function userCanBitfield( $bitfield, $field, User $user = null ) {
* @return bool
*/
public static function userCanBitfield( $bitfield, $field, User $user = null ) {
*
* @param IDatabase $db
* @param string $audience Public/user
*
* @param IDatabase $db
* @param string $audience Public/user
- * @param User $user User to check, or null to use $wgUser
+ * @param User|null $user User to check, or null to use $wgUser
* @return string|bool String on success, false on failure.
*/
public static function getExcludeClause( $db, $audience = 'public', User $user = null ) {
* @return string|bool String on success, false on failure.
*/
public static function getExcludeClause( $db, $audience = 'public', User $user = null ) {
/**
* Helper to make a link to the page, taking the plaintext
* value in consideration.
/**
* Helper to make a link to the page, taking the plaintext
* value in consideration.
- * @param Title $title The page
+ * @param Title|null $title The page
* @param array $parameters Query parameters
* @param string|null $html Linktext of the link as raw html
* @throws MWException
* @param array $parameters Query parameters
* @param string|null $html Linktext of the link as raw html
* @throws MWException
*
* @param int|RecentChange $rc Change identifier or RecentChange object
* @param bool $auto Was this patrol event automatic?
*
* @param int|RecentChange $rc Change identifier or RecentChange object
* @param bool $auto Was this patrol event automatic?
- * @param User $user User performing the action or null to use $wgUser
- * @param string|string[] $tags Change tags to add to the patrol log entry
+ * @param User|null $user User performing the action or null to use $wgUser
+ * @param string|string[]|null $tags Change tags to add to the patrol log entry
* ($user should be able to add the specified tags before this is called)
*
* @return bool
* ($user should be able to add the specified tags before this is called)
*
* @return bool
/**
* @param string $address String with an email address, or a User object
/**
* @param string $address String with an email address, or a User object
- * @param string $name Human-readable name if a string address is given
- * @param string $realName Human-readable real name if a string address is given
+ * @param string|null $name Human-readable name if a string address is given
+ * @param string|null $realName Human-readable real name if a string address is given
*/
function __construct( $address, $name = null, $realName = null ) {
if ( is_object( $address ) && $address instanceof User ) {
*/
function __construct( $address, $name = null, $realName = null ) {
if ( is_object( $address ) && $address instanceof User ) {
*
* @param string $text
* @param string $mime
*
* @param string $text
* @param string $mime
+ * @param array|null $params
* @return array
*/
function getThumbType( $text, $mime, $params = null ) {
* @return array
*/
function getThumbType( $text, $mime, $params = null ) {
*
* @param string $ext Extension of original file
* @param string $mime MIME type of original file
*
* @param string $ext Extension of original file
* @param string $mime MIME type of original file
- * @param array $params Handler specific rendering parameters
+ * @param array|null $params Handler specific rendering parameters
* @return array Thumbnail extension and MIME type
*/
function getThumbType( $ext, $mime, $params = null ) {
* @return array Thumbnail extension and MIME type
*/
function getThumbType( $ext, $mime, $params = null ) {
+ * @param string|null $title
* @param string|array $params Query parameters to add
* @return array
*/
* @param string|array $params Query parameters to add
* @return array
*/
/**
* @param string $ext
* @param string $mime
/**
* @param string $ext
* @param string $mime
+ * @param array|null $params
* @return bool
*/
function getThumbType( $ext, $mime, $params = null ) {
* @return bool
*/
function getThumbType( $ext, $mime, $params = null ) {
*
* @param string $ext
* @param string $mime
*
* @param string $ext
* @param string $mime
+ * @param array|null $params
* @return array
*/
function getThumbType( $ext, $mime, $params = null ) {
* @return array
*/
function getThumbType( $ext, $mime, $params = null ) {
/**
* Constructor and clear the article
* @param Title $title Reference to a Title object.
/**
* Constructor and clear the article
* @param Title $title Reference to a Title object.
- * @param int $oldId Revision ID, null to fetch from request, zero for current
+ * @param int|null $oldId Revision ID, null to fetch from request, zero for current
*/
public function __construct( Title $title, $oldId = null ) {
$this->mOldId = $oldId;
*/
public function __construct( Title $title, $oldId = null ) {
$this->mOldId = $oldId;
* @since 1.16 (r52326) for LiquidThreads
*
* @param int|null $oldid Revision ID or null
* @since 1.16 (r52326) for LiquidThreads
*
* @param int|null $oldid Revision ID or null
- * @param User $user The relevant user
+ * @param User|null $user The relevant user
* @return ParserOutput|bool ParserOutput or false if the given revision ID is not found
*/
public function getParserOutput( $oldid = null, User $user = null ) {
* @return ParserOutput|bool ParserOutput or false if the given revision ID is not found
*/
public function getParserOutput( $oldid = null, User $user = null ) {
/**
* @param string $reason
* @param bool $suppress
/**
* @param string $reason
* @param bool $suppress
- * @param int $u1 Unused
- * @param bool $u2 Unused
+ * @param int|null $u1 Unused
+ * @param bool|null $u2 Unused
* @param string &$error
* @return bool
*/
* @param string &$error
* @return bool
*/
* @param string $comment
* @param array $fileVersions
* @param bool $unsuppress
* @param string $comment
* @param array $fileVersions
* @param bool $unsuppress
- * @param User $user User performing the action, or null to use $wgUser
- * @param string|string[] $tags Change tags to add to log entry
+ * @param User|null $user User performing the action, or null to use $wgUser
+ * @param string|string[]|null $tags Change tags to add to log entry
* ($user should be able to add the specified tags before this is called)
* @return array|bool array(number of file revisions restored, number of image revisions
* restored, log message) on success, false on failure.
* ($user should be able to add the specified tags before this is called)
* @return array|bool array(number of file revisions restored, number of image revisions
* restored, log message) on success, false on failure.
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to $wgUser
* Revision::RAW get the text regardless of permissions
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to $wgUser
* Revision::RAW get the text regardless of permissions
- * @param User $user User object to check for, only if FOR_THIS_USER is passed
+ * @param User|null $user User object to check for, only if FOR_THIS_USER is passed
* to the $audience parameter
* @return Content|null The content of the current revision
*
* to the $audience parameter
* @return Content|null The content of the current revision
*
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to the given user
* Revision::RAW get the text regardless of permissions
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to the given user
* Revision::RAW get the text regardless of permissions
- * @param User $user User object to check for, only if FOR_THIS_USER is passed
+ * @param User|null $user User object to check for, only if FOR_THIS_USER is passed
* to the $audience parameter
* @return int User ID for the user that made the last article revision
*/
* to the $audience parameter
* @return int User ID for the user that made the last article revision
*/
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to the given user
* Revision::RAW get the text regardless of permissions
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to the given user
* Revision::RAW get the text regardless of permissions
- * @param User $user User object to check for, only if FOR_THIS_USER is passed
+ * @param User|null $user User object to check for, only if FOR_THIS_USER is passed
* to the $audience parameter
* @return User|null
*/
* to the $audience parameter
* @return User|null
*/
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to the given user
* Revision::RAW get the text regardless of permissions
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to the given user
* Revision::RAW get the text regardless of permissions
- * @param User $user User object to check for, only if FOR_THIS_USER is passed
+ * @param User|null $user User object to check for, only if FOR_THIS_USER is passed
* to the $audience parameter
* @return string Username of the user that made the last article revision
*/
* to the $audience parameter
* @return string Username of the user that made the last article revision
*/
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to the given user
* Revision::RAW get the text regardless of permissions
* Revision::FOR_PUBLIC to be displayed to all users
* Revision::FOR_THIS_USER to be displayed to the given user
* Revision::RAW get the text regardless of permissions
- * @param User $user User object to check for, only if FOR_THIS_USER is passed
+ * @param User|null $user User object to check for, only if FOR_THIS_USER is passed
* to the $audience parameter
* @return string Comment stored for the last article revision
*/
* to the $audience parameter
* @return string Comment stored for the last article revision
*/
* @param IDatabase $dbw
* @param Revision $revision For ID number, and text used to set
* length and redirect status fields
* @param IDatabase $dbw
* @param Revision $revision For ID number, and text used to set
* length and redirect status fields
- * @param int $lastRevision If given, will not overwrite the page field
+ * @param int|null $lastRevision If given, will not overwrite the page field
* when different from the currently set value.
* Giving 0 indicates the new page flag should be set on.
* when different from the currently set value.
* Giving 0 indicates the new page flag should be set on.
- * @param bool $lastRevIsRedirect If given, will optimize adding and
+ * @param bool|null $lastRevIsRedirect If given, will optimize adding and
* removing rows in redirect table.
* @return bool Success; false if the page row was missing or page_latest changed
*/
* removing rows in redirect table.
* @return bool Success; false if the page row was missing or page_latest changed
*/
* restores or repeats. The new revision is expected to have the exact same content as
* the given original revision. This is used with rollbacks and with dummy "null" revisions
* which are created to record things like page moves.
* restores or repeats. The new revision is expected to have the exact same content as
* the given original revision. This is used with rollbacks and with dummy "null" revisions
* which are created to record things like page moves.
- * @param User $user The user doing the edit
- * @param string $serialFormat IGNORED.
+ * @param User|null $user The user doing the edit
+ * @param string|null $serialFormat IGNORED.
* @param array|null $tags Change tags to apply to this edit
* Callers are responsible for permission checks
* (with ChangeTags::canAddTagsAccompanyingChange)
* @param array|null $tags Change tags to apply to this edit
* Callers are responsible for permission checks
* (with ChangeTags::canAddTagsAccompanyingChange)
* @param int &$cascade Set to false if cascading protection isn't allowed.
* @param string $reason
* @param User $user The user updating the restrictions
* @param int &$cascade Set to false if cascading protection isn't allowed.
* @param string $reason
* @param User $user The user updating the restrictions
- * @param string|string[] $tags Change tags to add to the pages and protection log entries
+ * @param string|string[]|null $tags Change tags to add to the pages and protection log entries
* ($user should be able to add the specified tags before this is called)
* @return Status Status object; if action is taken, $status->value is the log_id of the
* protection log entry.
* ($user should be able to add the specified tags before this is called)
* @return Status Status object; if action is taken, $status->value is the log_id of the
* protection log entry.
* @param string $reason Delete reason for deletion log
* @param bool $suppress Suppress all revisions and log the deletion in
* the suppression log instead of the deletion log
* @param string $reason Delete reason for deletion log
* @param bool $suppress Suppress all revisions and log the deletion in
* the suppression log instead of the deletion log
- * @param int $u1 Unused
- * @param bool $u2 Unused
+ * @param int|null $u1 Unused
+ * @param bool|null $u2 Unused
* @param array|string &$error Array of errors to append to
* @param array|string &$error Array of errors to append to
- * @param User $user The deleting user
+ * @param User|null $user The deleting user
* @return bool True if successful
*/
public function doDeleteArticle(
* @return bool True if successful
*/
public function doDeleteArticle(
* @param string $reason Delete reason for deletion log
* @param bool $suppress Suppress all revisions and log the deletion in
* the suppression log instead of the deletion log
* @param string $reason Delete reason for deletion log
* @param bool $suppress Suppress all revisions and log the deletion in
* the suppression log instead of the deletion log
- * @param int $u1 Unused
- * @param bool $u2 Unused
+ * @param int|null $u1 Unused
+ * @param bool|null $u2 Unused
* @param array|string &$error Array of errors to append to
* @param array|string &$error Array of errors to append to
- * @param User $deleter The deleting user
+ * @param User|null $deleter 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
* @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
* Make a self-link
*
* @param string $text Text displayed on the link
* Make a self-link
*
* @param string $text Text displayed on the link
- * @param array $query Associative array of parameter to be in the query string
- * @param string $type Link type used to create additional attributes, like "rel", "class" or
+ * @param array|null $query Associative array of parameter to be in the query string
+ * @param string|null $type Link type used to create additional attributes, like "rel", "class" or
* "title". Valid values (non-exhaustive list): 'first', 'last', 'prev', 'next', 'asc', 'desc'.
* @return string HTML fragment
*/
* "title". Valid values (non-exhaustive list): 'first', 'last', 'prev', 'next', 'asc', 'desc'.
* @return string HTML fragment
*/
/**
* @param Parser $parser
* @param string $date
/**
* @param Parser $parser
* @param string $date
- * @param string $defaultPref
+ * @param string|null $defaultPref
*
* @param Parser $parser
* @param string $s The text to encode.
*
* @param Parser $parser
* @param string $s The text to encode.
- * @param string $arg (optional): The type of encoding.
+ * @param string|null $arg (optional): The type of encoding.
* @return string
*/
public static function urlencode( $parser, $s = '', $arg = null ) {
* @return string
*/
public static function urlencode( $parser, $s = '', $arg = null ) {
/**
* @param Parser $parser
* @param string $num
/**
* @param Parser $parser
* @param string $num
+ * @param string|null $arg
* @return string
*/
public static function formatnum( $parser, $num = '', $arg = null ) {
* @return string
*/
public static function formatnum( $parser, $num = '', $arg = null ) {
* Note: function name changed to "mwnamespace" rather than "namespace"
* to not break PHP 5.3
* @param Parser $parser
* Note: function name changed to "mwnamespace" rather than "namespace"
* to not break PHP 5.3
* @param Parser $parser
+ * @param string|null $title
* @return mixed|string
*/
public static function mwnamespace( $parser, $title = null ) {
* @return mixed|string
*/
public static function mwnamespace( $parser, $title = null ) {
* Functions to get and normalize pagenames, corresponding to the magic words
* of the same names
* @param Parser $parser
* Functions to get and normalize pagenames, corresponding to the magic words
* of the same names
* @param Parser $parser
+ * @param string|null $title
* @return string
*/
public static function pagename( $parser, $title = null ) {
* @return string
*/
public static function pagename( $parser, $title = null ) {
* can't be called too many times per page.
* @param Parser $parser
* @param string $name
* can't be called too many times per page.
* @param Parser $parser
* @param string $name
- * @param string $arg1
- * @param string $arg2
+ * @param string|null $arg1
+ * @param string|null $arg2
* @return string
*/
public static function pagesincategory( $parser, $name = '', $arg1 = null, $arg2 = null ) {
* @return string
*/
public static function pagesincategory( $parser, $name = '', $arg1 = null, $arg2 = null ) {
*
* @param Parser $parser
* @param string $page Name of page to check (Default: empty string)
*
* @param Parser $parser
* @param string $page Name of page to check (Default: empty string)
- * @param string $raw Should number be human readable with commas or just number
+ * @param string|null $raw Should number be human readable with commas or just number
* @return string
*/
public static function pagesize( $parser, $page = '', $raw = null ) {
* @return string
*/
public static function pagesize( $parser, $page = '', $raw = null ) {
/**
* Get the pageid of a specified page
* @param Parser $parser
/**
* Get the pageid of a specified page
* @param Parser $parser
- * @param string $title Title to get the pageid from
+ * @param string|null $title Title to get the pageid from
* @return int|null|string
* @since 1.23
*/
* @return int|null|string
* @since 1.23
*/
/**
* Get the id from the last revision of a specified page.
* @param Parser $parser
/**
* Get the id from the last revision of a specified page.
* @param Parser $parser
- * @param string $title Title to get the id from
+ * @param string|null $title Title to get the id from
* @return int|null|string
* @since 1.23
*/
* @return int|null|string
* @since 1.23
*/
/**
* Get the day from the last revision of a specified page.
* @param Parser $parser
/**
* Get the day from the last revision of a specified page.
* @param Parser $parser
- * @param string $title Title to get the day from
+ * @param string|null $title Title to get the day from
* @return string
* @since 1.23
*/
* @return string
* @since 1.23
*/
/**
* Get the day with leading zeros from the last revision of a specified page.
* @param Parser $parser
/**
* Get the day with leading zeros from the last revision of a specified page.
* @param Parser $parser
- * @param string $title Title to get the day from
+ * @param string|null $title Title to get the day from
* @return string
* @since 1.23
*/
* @return string
* @since 1.23
*/
/**
* Get the month with leading zeros from the last revision of a specified page.
* @param Parser $parser
/**
* Get the month with leading zeros from the last revision of a specified page.
* @param Parser $parser
- * @param string $title Title to get the month from
+ * @param string|null $title Title to get the month from
* @return string
* @since 1.23
*/
* @return string
* @since 1.23
*/
/**
* Get the month from the last revision of a specified page.
* @param Parser $parser
/**
* Get the month from the last revision of a specified page.
* @param Parser $parser
- * @param string $title Title to get the month from
+ * @param string|null $title Title to get the month from
* @return string
* @since 1.23
*/
* @return string
* @since 1.23
*/
/**
* Get the year from the last revision of a specified page.
* @param Parser $parser
/**
* Get the year from the last revision of a specified page.
* @param Parser $parser
- * @param string $title Title to get the year from
+ * @param string|null $title Title to get the year from
* @return string
* @since 1.23
*/
* @return string
* @since 1.23
*/
/**
* Get the timestamp from the last revision of a specified page.
* @param Parser $parser
/**
* Get the timestamp from the last revision of a specified page.
* @param Parser $parser
- * @param string $title Title to get the timestamp from
+ * @param string|null $title Title to get the timestamp from
* @return string
* @since 1.23
*/
* @return string
* @since 1.23
*/
/**
* Get the user from the last revision of a specified page.
* @param Parser $parser
/**
* Get the user from the last revision of a specified page.
* @param Parser $parser
- * @param string $title Title to get the user from
+ * @param string|null $title Title to get the user from
* @return string
* @since 1.23
*/
* @return string
* @since 1.23
*/
* @param ParserOptions $options
* @param bool $linestart
* @param bool $clearState
* @param ParserOptions $options
* @param bool $linestart
* @param bool $clearState
- * @param int $revid Number to pass in {{REVISIONID}}
+ * @param int|null $revid Number to pass in {{REVISIONID}}
* @return ParserOutput A ParserOutput
*/
public function parse(
* @return ParserOutput A ParserOutput
*/
public function parse(
* Also removes comments.
* Do not call this function recursively.
* @param string $text
* Also removes comments.
* Do not call this function recursively.
* @param string $text
+ * @param Title|null $title
* @param ParserOptions $options
* @param int|null $revid
* @param bool|PPFrame $frame
* @param ParserOptions $options
* @param int|null $revid
* @param bool|PPFrame $frame
/**
* Accessor/mutator for the Title object
*
/**
* Accessor/mutator for the Title object
*
- * @param Title $x Title object or null to just get the current one
+ * @param Title|null $x Title object or null to just get the current one
* @return Title
*/
public function Title( $x = null ) {
* @return Title
*/
public function Title( $x = null ) {
/**
* Accessor/mutator for the ParserOptions object
*
/**
* Accessor/mutator for the ParserOptions object
*
- * @param ParserOptions $x New value or null to just get the current one
+ * @param ParserOptions|null $x New value or null to just get the current one
* @return ParserOptions Current ParserOptions object
*/
public function Options( $x = null ) {
* @return ParserOptions Current ParserOptions object
*/
public function Options( $x = null ) {
* @since 1.21
* @param string|bool $url Optional URL, to extract the domain from for rel =>
* nofollow if appropriate
* @since 1.21
* @param string|bool $url Optional URL, to extract the domain from for rel =>
* nofollow if appropriate
- * @param Title $title Optional Title, for wgNoFollowNsExceptions lookups
+ * @param Title|null $title Optional Title, for wgNoFollowNsExceptions lookups
* @return string|null Rel attribute for $url
*/
public static function getExternalLinkRel( $url = false, $title = null ) {
* @return string|null Rel attribute for $url
*/
public static function getExternalLinkRel( $url = false, $title = null ) {
* @warning For interaction with the parser cache, use
* WikiPage::makeParserOptions(), ContentHandler::makeParserOptions(), or
* ParserOptions::newCanonical() instead.
* @warning For interaction with the parser cache, use
* WikiPage::makeParserOptions(), ContentHandler::makeParserOptions(), or
* ParserOptions::newCanonical() instead.
- * @param User $user
- * @param Language $lang
+ * @param User|null $user
+ * @param Language|null $lang
*/
public function __construct( $user = null, $lang = null ) {
if ( $user === null ) {
*/
public function __construct( $user = null, $lang = null ) {
if ( $user === null ) {
*
* @since 1.17
* @param string[] $forOptions
*
* @since 1.17
* @param string[] $forOptions
- * @param Title $title Used to get the content language of the page (since r97636)
+ * @param Title|null $title Used to get the content language of the page (since r97636)
* @return string Page rendering hash
*/
public function optionsHash( $forOptions, $title = null ) {
* @return string Page rendering hash
*/
public function optionsHash( $forOptions, $title = null ) {
* Add one or more variables to be set in mw.config in JavaScript.
*
* @param string|array $keys Key or array of key/value pairs.
* Add one or more variables to be set in mw.config in JavaScript.
*
* @param string|array $keys Key or array of key/value pairs.
- * @param mixed $value [optional] Value of the configuration variable.
+ * @param mixed|null $value [optional] Value of the configuration variable.
* @since 1.23
*/
public function addJsConfigVars( $keys, $value = null ) {
* @since 1.23
*/
public function addJsConfigVars( $keys, $value = null ) {
* Cleans up HTML, removes dangerous tags and attributes, and
* removes HTML comments
* @param string $text
* Cleans up HTML, removes dangerous tags and attributes, and
* removes HTML comments
* @param string $text
- * @param callable $processCallback Callback to do any variable or parameter
+ * @param callable|null $processCallback Callback to do any variable or parameter
* replacements in HTML attribute values
* @param array|bool $args Arguments for the processing callback
* @param array $extratags For any extra tags to include
* @param array $removetags For any tags (default or extra) to exclude
* replacements in HTML attribute values
* @param array|bool $args Arguments for the processing callback
* @param array $extratags For any extra tags to include
* @param array $removetags For any tags (default or extra) to exclude
- * @param callable $warnCallback (Deprecated) Callback allowing the
+ * @param callable|null $warnCallback (Deprecated) Callback allowing the
* addition of a tracking category when bad input is encountered.
* DO NOT ADD NEW PARAMETERS AFTER $warnCallback, since it will be
* removed shortly.
* addition of a tracking category when bad input is encountered.
* DO NOT ADD NEW PARAMETERS AFTER $warnCallback, since it will be
* removed shortly.
* @param int $revid ID of the revision being parsed.
* @param bool $useParserCache Whether to use the parser cache.
* operation.
* @param int $revid ID of the revision being parsed.
* @param bool $useParserCache Whether to use the parser cache.
* operation.
- * @param Content|string $content Content to parse or null to load it; may
+ * @param Content|string|null $content Content to parse or null to load it; may
* also be given as a wikitext string, for BC.
*/
public function __construct( WikiPage $page, ParserOptions $parserOptions,
* also be given as a wikitext string, for BC.
*/
public function __construct( WikiPage $page, ParserOptions $parserOptions,
abstract public function scopedProfileIn( $section );
/**
abstract public function scopedProfileIn( $section );
/**
- * @param SectionProfileCallback &$section
+ * @param SectionProfileCallback|null &$section
*/
public function scopedProfileOut( SectionProfileCallback &$section = null ) {
$section = null;
*/
public function scopedProfileOut( SectionProfileCallback &$section = null ) {
$section = null;
/**
* Register core modules and runs registration hooks.
/**
* Register core modules and runs registration hooks.
- * @param Config $config [optional]
- * @param LoggerInterface $logger [optional]
+ * @param Config|null $config [optional]
+ * @param LoggerInterface|null $logger [optional]
*/
public function __construct( Config $config = null, LoggerInterface $logger = null ) {
global $IP;
*/
public function __construct( Config $config = null, LoggerInterface $logger = null ) {
global $IP;
* Register a module with the ResourceLoader system.
*
* @param mixed $name Name of module as a string or List of name/object pairs as an array
* Register a module with the ResourceLoader system.
*
* @param mixed $name Name of module as a string or List of name/object pairs as an array
- * @param array $info Module info array. For backwards compatibility with 1.17alpha,
+ * @param array|null $info Module info array. For backwards compatibility with 1.17alpha,
* this may also be a ResourceLoaderModule object. Optional when using
* multiple-registration calling style.
* @throws MWException If a duplicate module registration is attempted
* this may also be a ResourceLoaderModule object. Optional when using
* multiple-registration calling style.
* @throws MWException If a duplicate module registration is attempted
* Source IDs are typically the same as the Wiki ID or database name (e.g. lowercase a-z).
*
* @param array|string $id Source ID (string), or [ id1 => loadUrl, id2 => loadUrl, ... ]
* Source IDs are typically the same as the Wiki ID or database name (e.g. lowercase a-z).
*
* @param array|string $id Source ID (string), or [ id1 => loadUrl, id2 => loadUrl, ... ]
- * @param string|array $loadUrl load.php url (string), or array with loadUrl key for
+ * @param string|array|null $loadUrl load.php url (string), or array with loadUrl key for
* backwards-compatibility.
* @throws MWException
*/
* backwards-compatibility.
* @throws MWException
*/
* Set the state of modules with the given names to the given states
*
* @param string $name
* Set the state of modules with the given names to the given states
*
* @param string $name
+ * @param string|null $state
* @return string JavaScript code
*/
public static function makeLoaderStateScript( $name, $state = null ) {
* @return string JavaScript code
*/
public static function makeLoaderStateScript( $name, $state = null ) {
* Registers modules with the given names and parameters.
*
* @param string $name Module name
* Registers modules with the given names and parameters.
*
* @param string $name Module name
- * @param string $version Module version hash
- * @param array $dependencies List of module names on which this module depends
- * @param string $group Group which the module is in
- * @param string $source Source of the module, or 'local' if not foreign
- * @param string $skip Script body of the skip function
+ * @param string|null $version Module version hash
+ * @param array|null $dependencies List of module names on which this module depends
+ * @param string|null $group Group which the module is in
+ * @param string|null $source Source of the module, or 'local' if not foreign
+ * @param string|null $skip Script body of the skip function
* @return string JavaScript code
*/
public static function makeLoaderRegisterScript( $name, $version = null,
* @return string JavaScript code
*/
public static function makeLoaderRegisterScript( $name, $version = null,
* Register sources with the given IDs and properties.
*
* @param string $id Source ID
* Register sources with the given IDs and properties.
*
* @param string $id Source ID
- * @param string $loadUrl load.php url
+ * @param string|null $loadUrl load.php url
* @return string JavaScript code
*/
public static function makeLoaderSourcesScript( $id, $loadUrl = null ) {
* @return string JavaScript code
*/
public static function makeLoaderSourcesScript( $id, $loadUrl = null ) {
* startup module if the client has adequate support for MediaWiki JavaScript code.
*
* @param string $script JavaScript code
* startup module if the client has adequate support for MediaWiki JavaScript code.
*
* @param string $script JavaScript code
- * @param string $nonce [optional] Content-Security-Policy nonce (from OutputPage::getCSPNonce)
+ * @param string|null $nonce [optional] Content-Security-Policy nonce
+ * (from OutputPage::getCSPNonce)
* @return string|WrappedString HTML
*/
public static function makeInlineScript( $script, $nonce = null ) {
* @return string|WrappedString HTML
*/
public static function makeInlineScript( $script, $nonce = null ) {
* @param array $modules
* @param string $lang
* @param string $skin
* @param array $modules
* @param string $lang
* @param string $skin
- * @param string $user
- * @param string $version
+ * @param string|null $user
+ * @param string|null $version
+ * @param string|null $only
* @param bool $printable
* @param bool $handheld
* @param array $extraQuery
* @param bool $printable
* @param bool $handheld
* @param array $extraQuery
* @param array $modules One or more module names
* @param string $only ResourceLoaderModule TYPE_ class constant
* @param array $extraQuery [optional] Array with extra query parameters for the request
* @param array $modules One or more module names
* @param string $only ResourceLoaderModule TYPE_ class constant
* @param array $extraQuery [optional] Array with extra query parameters for the request
- * @param string $nonce [optional] Content-Security-Policy nonce (from OutputPage::getCSPNonce)
+ * @param string|null $nonce [optional] Content-Security-Policy nonce
+ * (from OutputPage::getCSPNonce)
* @return string|WrappedStringList HTML
*/
public static function makeLoad( ResourceLoaderContext $mainContext, array $modules, $only,
* @return string|WrappedStringList HTML
*/
public static function makeLoad( ResourceLoaderContext $mainContext, array $modules, $only,
*
* @param array $options List of options; if not given or empty, an empty module will be
* constructed
*
* @param array $options List of options; if not given or empty, an empty module will be
* constructed
- * @param string $localBasePath Base path to prepend to all local paths in $options. Defaults
- * to $IP
- * @param string $remoteBasePath Base path to prepend to all remote paths in $options. Defaults
- * to $wgResourceBasePath
+ * @param string|null $localBasePath Base path to prepend to all local paths in $options.
+ * Defaults to $IP
+ * @param string|null $remoteBasePath Base path to prepend to all remote paths in $options.
+ * Defaults to $wgResourceBasePath
*
* Below is a description for the $options array:
* @throws InvalidArgumentException
*
* Below is a description for the $options array:
* @throws InvalidArgumentException
* Implementation note: the amount of global state used in this function is staggering.
*
* @param array $options Module definition
* Implementation note: the amount of global state used in this function is staggering.
*
* @param array $options Module definition
- * @param string $localBasePath Path to use if not provided in module definition. Defaults
+ * @param string|null $localBasePath Path to use if not provided in module definition. Defaults
- * @param string $remoteBasePath Path to use if not provided in module definition. Defaults
+ * @param string|null $remoteBasePath Path to use if not provided in module definition. Defaults
* to $wgResourceBasePath
* @return array Array( localBasePath, remoteBasePath )
*/
* to $wgResourceBasePath
* @return array Array( localBasePath, remoteBasePath )
*/
*
* @param array $list List of lists to select from
* @param string $key Key to look for in $map
*
* @param array $list List of lists to select from
* @param string $key Key to look for in $map
- * @param string $fallback Key to look for in $list if $key doesn't exist
+ * @param string|null $fallback Key to look for in $list if $key doesn't exist
* @return array List of elements from $map which matched $key or $fallback,
* or an empty list in case of no match
*/
* @return array List of elements from $map which matched $key or $fallback,
* or an empty list in case of no match
*/
* @private
* @param array $styles Map of media type to file paths to read, remap, and concatenate
* @param bool $flip
* @private
* @param array $styles Map of media type to file paths to read, remap, and concatenate
* @param bool $flip
- * @param ResourceLoaderContext $context
+ * @param ResourceLoaderContext|null $context
* @return array List of concatenated and remapped CSS data from $styles,
* keyed by media type
* @throws MWException
* @return array List of concatenated and remapped CSS data from $styles,
* keyed by media type
* @throws MWException
*
* @param array $options List of options; if not given or empty, an empty module will be
* constructed
*
* @param array $options List of options; if not given or empty, an empty module will be
* constructed
- * @param string $localBasePath Base path to prepend to all local paths in $options. Defaults
+ * @param string|null $localBasePath Base path to prepend to all local paths in $options. Defaults
* to $IP
*
* Below is a description for the $options array:
* to $IP
*
* Below is a description for the $options array:
* Extract a local base path from module definition information.
*
* @param array $options Module definition
* Extract a local base path from module definition information.
*
* @param array $options Module definition
- * @param string $localBasePath Path to use if not provided in module definition. Defaults
+ * @param string|null $localBasePath Path to use if not provided in module definition. Defaults
* to $IP
* @return string Local base path
*/
* to $IP
* @return string Local base path
*/
- * @param ResourceLoaderContext $context
+ * @param ResourceLoaderContext|null $context
* @return array
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
* @return array
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
- * @param ResourceLoaderContext $context
+ * @param ResourceLoaderContext|null $context
* @return array
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
* @return array
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
* Note: It is expected that $context will be made non-optional in the near
* future.
*
* Note: It is expected that $context will be made non-optional in the near
* future.
*
- * @param ResourceLoaderContext $context
+ * @param ResourceLoaderContext|null $context
* @return array List of module names as strings
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
* @return array List of module names as strings
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
- * @param ResourceLoaderContext $context
+ * @param ResourceLoaderContext|null $context
* @return array
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
* @return array
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
protected $targets = [ 'desktop', 'mobile' ];
/**
protected $targets = [ 'desktop', 'mobile' ];
/**
- * @param ResourceLoaderContext $context
+ * @param ResourceLoaderContext|null $context
* @return array List of module names as strings
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
* @return array List of module names as strings
*/
public function getDependencies( ResourceLoaderContext $context = null ) {
- * @param array $options For back-compat, this can be omitted in favour of overwriting getPages.
+ * @param array|null $options For back-compat, this can be omitted in favour of overwriting
+ * getPages.
*/
public function __construct( array $options = null ) {
if ( is_null( $options ) ) {
*/
public function __construct( array $options = null ) {
if ( is_null( $options ) ) {
- * @param IDatabase $db The database to search from
+ * @param IDatabase|null $db The database to search from
*/
public function __construct( IDatabase $db = null ) {
if ( $db ) {
*/
public function __construct( IDatabase $db = null ) {
if ( $db ) {
*
* @todo This isn't ideal, we'd really like to have content-specific handling here
* @param Title $t Title we're indexing
*
* @todo This isn't ideal, we'd really like to have content-specific handling here
* @param Title $t Title we're indexing
- * @param Content $c Content of the page to index
+ * @param Content|null $c Content of the page to index
* @return string
*/
public function getTextFromContent( Title $t, Content $c = null ) {
* @return string
*/
public function getTextFromContent( Title $t, Content $c = null ) {
/**
* Create SearchEngine of the given type.
/**
* Create SearchEngine of the given type.
+ * @param string|null $type
* @return SearchEngine
*/
public function create( $type = null ) {
* @return SearchEngine
*/
public function create( $type = null ) {
* @param string $text
* @param int $start
* @param int $end
* @param string $text
* @param int $start
* @param int $end
- * @param int &$posStart (out) actual start position
- * @param int &$posEnd (out) actual end position
+ * @param int|null &$posStart (out) actual start position
+ * @param int|null &$posEnd (out) actual end position
* @return string
*/
function extract( $text, $start, $end, &$posStart = null, &$posEnd = null ) {
* @return string
*/
function extract( $text, $start, $end, &$posStart = null, &$posEnd = null ) {
* Return a new SearchResult and initializes it with a title.
*
* @param Title $title
* Return a new SearchResult and initializes it with a title.
*
* @param Title $title
- * @param SearchResultSet $parentSet
+ * @param SearchResultSet|null $parentSet
* @return SearchResult
*/
public static function newFromTitle( $title, SearchResultSet $parentSet = null ) {
* @return SearchResult
*/
public static function newFromTitle( $title, SearchResultSet $parentSet = null ) {
* @param \WebRequest $request
* @param string $key
* @param string $prefix
* @param \WebRequest $request
* @param string $key
* @param string $prefix
- * @param mixed $default
+ * @param mixed|null $default
* @return mixed
*/
protected function getCookie( $request, $key, $prefix, $default = null ) {
* @return mixed
*/
protected function getCookie( $request, $key, $prefix, $default = null ) {
/**
* Fetch a value from the session
* @param string|int $key
/**
* Fetch a value from the session
* @param string|int $key
- * @param mixed $default Returned if $this->exists( $key ) would be false
+ * @param mixed|null $default Returned if $this->exists( $key ) would be false
* @return mixed
*/
public function get( $key, $default = null ) {
* @return mixed
*/
public function get( $key, $default = null ) {
/**
* Fetch a value from the session that was set with self::setSecret()
* @param string|int $key
/**
* Fetch a value from the session that was set with self::setSecret()
* @param string|int $key
- * @param mixed $default Returned if $this->exists( $key ) would be false or decryption fails
+ * @param mixed|null $default Returned if $this->exists( $key ) would be false or decryption fails
* @return mixed
*/
public function getSecret( $key, $default = null ) {
* @return mixed
*/
public function getSecret( $key, $default = null ) {
/**
* Set the "logged out" timestamp
/**
* Set the "logged out" timestamp
*/
public function setLoggedOutTimestamp( $ts = null ) {
$ts = (int)$ts;
*/
public function setLoggedOutTimestamp( $ts = null ) {
$ts = (int)$ts;
* or MediaWikiServices::getSiteLookup() instead.
*
* @param null $sitesTable IGNORED
* or MediaWikiServices::getSiteLookup() instead.
*
* @param null $sitesTable IGNORED
- * @param null $cache IGNORED
+ * @param BagOStuff|null $cache IGNORED
* If you pass "flat" as an option then the returned array will be a flat array
* of footer icons instead of a key/value array of footerlinks arrays broken
* up into categories.
* If you pass "flat" as an option then the returned array will be a flat array
* of footer icons instead of a key/value array of footerlinks arrays broken
* up into categories.
- * @param string $option
+ * @param string|null $option
* @return array|mixed
*/
function getFooterLinks( $option = null ) {
* @return array|mixed
*/
function getFooterLinks( $option = null ) {
* in the list of footer icons. This is mostly useful for skins which only
* display the text from footericons instead of the images and don't want a
* duplicate copyright statement because footerlinks already rendered one.
* in the list of footer icons. This is mostly useful for skins which only
* display the text from footericons instead of the images and don't want a
* duplicate copyright statement because footerlinks already rendered one.
- * @param string $option
+ * @param string|null $option
* @return array
*/
function getFooterIcons( $option = null ) {
* @return array
*/
function getFooterIcons( $option = null ) {
- * @param Config $config
+ * @param Config|null $config
*/
function __construct( Config $config = null ) {
$this->data = [];
*/
function __construct( Config $config = null ) {
$this->data = [];
* Gets the template data requested
* @since 1.22
* @param string $name Key for the data
* Gets the template data requested
* @since 1.22
* @param string $name Key for the data
- * @param mixed $default Optional default (or null)
+ * @param mixed|null $default Optional default (or null)
* @return mixed The value of the data requested or the deafult
*/
public function get( $name, $default = null ) {
* @return mixed The value of the data requested or the deafult
*/
public function get( $name, $default = null ) {
/**
* Outputs the HTML generated by other functions.
/**
* Outputs the HTML generated by other functions.
- * @param OutputPage $out
+ * @param OutputPage|null $out
*/
abstract function outputPage( OutputPage $out = null );
/**
* @param array $data
*/
abstract function outputPage( OutputPage $out = null );
/**
* @param array $data
- * @param string $nonce OutputPage::getCSPNonce()
+ * @param string|null $nonce OutputPage::getCSPNonce()
* @return string|WrappedString HTML
*/
static function makeVariablesScript( $data, $nonce = null ) {
* @return string|WrappedString HTML
*/
static function makeVariablesScript( $data, $nonce = null ) {
- * @param OutputPage $out Defaults to $this->getOutput() if left as null
+ * @param OutputPage|null $out Defaults to $this->getOutput() if left as null
* @return string
*/
function subPageSubtitle( $out = null ) {
* @return string
*/
function subPageSubtitle( $out = null ) {
* the current page, if the section is included from a template)
* @param string $section The designation of the section being pointed to,
* to be included in the link, like "§ion=$section"
* the current page, if the section is included from a template)
* @param string $section The designation of the section being pointed to,
* to be included in the link, like "§ion=$section"
- * @param string $tooltip The tooltip to use for the link: will be escaped
+ * @param string|null $tooltip The tooltip to use for the link: will be escaped
* and wrapped in the 'editsectionhint' message
* @param string $lang Language code
* @return string HTML to use for edit link
* and wrapped in the 'editsectionhint' message
* @param string $lang Language code
* @return string HTML to use for edit link
/**
* initialize various variables and generate the template
*
/**
* initialize various variables and generate the template
*
- * @param OutputPage $out
+ * @param OutputPage|null $out
*/
function outputPage( OutputPage $out = null ) {
Profiler::instance()->setTemplated( true );
*/
function outputPage( OutputPage $out = null ) {
Profiler::instance()->setTemplated( true );
- * @param array $personalTools
+ * @param array|null $personalTools
* @param array $options
* @return string
*/
* @param array $options
* @return string
*/
* Used to preserve POST data over a HTTP redirect.
*
* @param array $data
* Used to preserve POST data over a HTTP redirect.
*
* @param array $data
- * @param bool $wasPosted
+ * @param bool|null $wasPosted
*/
protected function setRequest( array $data, $wasPosted = null ) {
$request = $this->getContext()->getRequest();
*/
protected function setRequest( array $data, $wasPosted = null ) {
$request = $this->getContext()->getRequest();
* Load or initialize $authAction, $authRequests and $subPage.
* Subclasses should call this from execute() or otherwise ensure the variables are initialized.
* @param string $subPage Subpage of the special page.
* Load or initialize $authAction, $authRequests and $subPage.
* Subclasses should call this from execute() or otherwise ensure the variables are initialized.
* @param string $subPage Subpage of the special page.
- * @param string $authAction Override auth action specified in request (this is useful
+ * @param string|null $authAction Override auth action specified in request (this is useful
* when the form needs to be changed from <action> to <action>_CONTINUE after a successful
* authentication step)
* @param bool $reset Regenerate the requests even if a cached version is available
* when the form needs to be changed from <action> to <action>_CONTINUE after a successful
* authentication step)
* @param bool $reset Regenerate the requests even if a cached version is available
* Get an array value, or a default if it does not exist.
* @param array $array
* @param string $fieldName
* Get an array value, or a default if it does not exist.
* @param array $array
* @param string $fieldName
- * @param mixed $default
+ * @param mixed|null $default
* @return mixed
*/
protected static function getField( array $array, $fieldName, $default = null ) {
* @return mixed
*/
protected static function getField( array $array, $fieldName, $default = null ) {
- * @param WebRequest $request
+ * @param WebRequest|null $request
*/
public function __construct( $request = null ) {
wfDeprecated( 'LoginForm', '1.27' );
*/
public function __construct( $request = null ) {
wfDeprecated( 'LoginForm', '1.27' );
/**
* Get or set whether this special page is listed in Special:SpecialPages
* @since 1.6
/**
* Get or set whether this special page is listed in Special:SpecialPages
* @since 1.6
* @return bool
*/
function listed( $x = null ) {
* @return bool
*/
function listed( $x = null ) {
/**
* Whether the special page is being evaluated via transclusion
/**
* Whether the special page is being evaluated via transclusion
* @return bool
*/
function including( $x = null ) {
* @return bool
*/
function including( $x = null ) {
* Note that this does not in any way check that the user is authorized to use this special page
* (use checkPermissions() for that).
*
* Note that this does not in any way check that the user is authorized to use this special page
* (use checkPermissions() for that).
*
- * @param string $level A security level. Can be an arbitrary string, defaults to the page name.
+ * @param string|null $level A security level. Can be an arbitrary string, defaults to the page
+ * name.
* @return bool False means a redirect to the reauthentication page has been set and processing
* of the special page should be aborted.
* @throws ErrorPageError If the security level cannot be met, even with reauthentication.
* @return bool False means a redirect to the reauthentication page has been set and processing
* of the special page should be aborted.
* @throws ErrorPageError If the security level cannot be met, even with reauthentication.
* Return categorised listable special pages which are available
* for the current user, and everyone.
*
* Return categorised listable special pages which are available
* for the current user, and everyone.
*
- * @param User $user User object to check permissions, $wgUser will be used
+ * @param User|null $user User object to check permissions, $wgUser will be used
* if not provided
* @return array ( string => Specialpage )
*/
* if not provided
* @return array ( string => Specialpage )
*/
* @todo Should be in Block.php?
* @param string $par Subpage parameter passed to setup, or data value from
* the HTMLForm
* @todo Should be in Block.php?
* @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 WebRequest|null $request Optionally try and get data from a request too
* @return array [ User|string|null, Block::TYPE_ constant|null ]
*/
public static function getTargetAndType( $par, WebRequest $request = null ) {
* @return array [ User|string|null, Block::TYPE_ constant|null ]
*/
public static function getTargetAndType( $par, WebRequest $request = null ) {
/**
* Process the form on POST submission.
* @param array $data
/**
* Process the form on POST submission.
* @param array $data
- * @param HTMLForm $form
+ * @param HTMLForm|null $form
* @return bool|array True for success, false for didn't-try, array of errors on failure
*/
public function onSubmit( array $data, HTMLForm $form = null ) {
* @return bool|array True for success, false for didn't-try, array of errors on failure
*/
public function onSubmit( array $data, HTMLForm $form = null ) {
*
* @param User $user
* @param string $editToken Edit token
*
* @param User $user
* @param string $editToken Edit token
- * @param Config $config optional for backwards compatibility
+ * @param Config|null $config optional for backwards compatibility
* @return string|null Null on success or string on error
*/
public static function getPermissionsError( $user, $editToken, Config $config = null ) {
* @return string|null Null on success or string on error
*/
public static function getPermissionsError( $user, $editToken, Config $config = null ) {
/**
* @param int $namespace
* @param string $prefix
/**
* @param int $namespace
* @param string $prefix
- * @param string $from List all pages from this name (default false)
+ * @param string|null $from List all pages from this name (default false)
*/
protected function showPrefixChunk( $namespace, $prefix, $from = null ) {
global $wgContLang;
*/
protected function showPrefixChunk( $namespace, $prefix, $from = null ) {
global $wgContLang;
* specific title if one is set.
*
* @param string $permission
* specific title if one is set.
*
* @param string $permission
+ * @param User|null $user
* @return bool
*/
protected function isAllowed( $permission, User $user = null ) {
* @return bool
*/
protected function isAllowed( $permission, User $user = null ) {
class SpecialUpload extends SpecialPage {
/**
* Get data POSTed through the form and assign them to the object
class SpecialUpload extends SpecialPage {
/**
* Get data POSTed through the form and assign them to the object
- * @param WebRequest $request Data posted.
+ * @param WebRequest|null $request Data posted.
*/
public function __construct( $request = null ) {
parent::__construct( 'Upload', 'upload' );
*/
public function __construct( $request = null ) {
parent::__construct( 'Upload', 'upload' );
* @param string $license
* @param string $copyStatus
* @param string $source
* @param string $license
* @param string $copyStatus
* @param string $source
- * @param Config $config Configuration object to load data from
+ * @param Config|null $config Configuration object to load data from
* @return string
*/
public static function getInitialPageText( $comment = '', $license = '',
* @return string
*/
public static function getInitialPageText( $comment = '', $license = '',
private $blockStatusByUid;
/**
private $blockStatusByUid;
/**
- * @param IContextSource $context
+ * @param IContextSource|null $context
* @param FormOptions $opts
*/
function __construct( IContextSource $context = null, FormOptions $opts ) {
* @param FormOptions $opts
*/
function __construct( IContextSource $context = null, FormOptions $opts ) {
protected $userGroupCache;
/**
protected $userGroupCache;
/**
- * @param IContextSource $context
- * @param array $par (Default null)
- * @param bool $including Whether this page is being transcluded in
+ * @param IContextSource|null $context
+ * @param array|null $par (Default null)
+ * @param bool|null $including Whether this page is being transcluded in
* another page
*/
function __construct( IContextSource $context = null, $par = null, $including = null ) {
* another page
*/
function __construct( IContextSource $context = null, $par = null, $including = null ) {
* Perform a clean/repair operation
* @param string $text HTML to check
* @param bool $stderr Whether to read result from STDERR rather than STDOUT
* Perform a clean/repair operation
* @param string $text HTML to check
* @param bool $stderr Whether to read result from STDERR rather than STDOUT
- * @param int &$retval Exit code (-1 on internal error)
+ * @param int|null &$retval Exit code (-1 on internal error)
* @return null|string
* @throws MWException
*/
* @return null|string
* @throws MWException
*/
*
* @param string $text HTML to check
* @param bool $stderr Whether to read result from STDERR rather than STDOUT
*
* @param string $text HTML to check
* @param bool $stderr Whether to read result from STDERR rather than STDOUT
- * @param int &$retval Exit code (-1 on internal error)
+ * @param int|null &$retval Exit code (-1 on internal error)
* @return string|null
*/
protected function cleanWrapped( $text, $stderr = false, &$retval = null ) {
* @return string|null
*/
protected function cleanWrapped( $text, $stderr = false, &$retval = null ) {
*
* @param string $text HTML to check
* @param bool $stderr Whether to read result from error status instead of output
*
* @param string $text HTML to check
* @param bool $stderr Whether to read result from error status instead of output
- * @param int &$retval Exit code (-1 on internal error)
+ * @param int|null &$retval Exit code (-1 on internal error)
* @return string|null
*/
protected function cleanWrapped( $text, $stderr = false, &$retval = null ) {
* @return string|null
*/
protected function cleanWrapped( $text, $stderr = false, &$retval = null ) {
*
* @param string $text HTML to check
* @param bool $stderr Whether to read result from error status instead of output
*
* @param string $text HTML to check
* @param bool $stderr Whether to read result from error status instead of output
- * @param int &$retval Exit code (-1 on internal error)
+ * @param int|null &$retval Exit code (-1 on internal error)
* @return string|null
*/
protected function cleanWrapped( $text, $stderr = false, &$retval = null ) {
* @return string|null
*/
protected function cleanWrapped( $text, $stderr = false, &$retval = null ) {
/**
* @param string $errorMessage Localisation message describing the error (since MW 1.26)
/**
* @param string $errorMessage Localisation message describing the error (since MW 1.26)
- * @param string $titleText The invalid title text (since MW 1.26)
+ * @param string|null $titleText The invalid title text (since MW 1.26)
* @param string[] $errorMessageParameters Additional parameters for the error message.
* $titleText will be appended if it's not null. (since MW 1.26)
*/
* @param string[] $errorMessageParameters Additional parameters for the error message.
* $titleText will be appended if it's not null. (since MW 1.26)
*/
/**
* @param string $tempPath File system path to temporary file containing the upload
/**
* @param string $tempPath File system path to temporary file containing the upload
+ * @param int|null $fileSize
*/
protected function setTempFile( $tempPath, $fileSize = null ) {
$this->mTempPath = $tempPath;
*/
protected function setTempFile( $tempPath, $fileSize = null ) {
$this->mTempPath = $tempPath;
* file again.
*
* @deprecated since 1.28 Use tryStashFile() instead
* file again.
*
* @deprecated since 1.28 Use tryStashFile() instead
+ * @param User|null $user
* @return UploadStashFile Stashed file
* @throws UploadStashBadPathException
* @throws UploadStashFileException
* @return UploadStashFile Stashed file
* @throws UploadStashBadPathException
* @throws UploadStashFileException
/**
* Implementation for stashFile() and tryStashFile().
*
/**
* Implementation for stashFile() and tryStashFile().
*
+ * @param User|null $user
* @return UploadStashFile Stashed file
*/
protected function doStashFile( User $user = null ) {
* @return UploadStashFile Stashed file
*/
protected function doStashFile( User $user = null ) {
* @todo Replace this with a whitelist filter!
* @param string $element
* @param array $attribs
* @todo Replace this with a whitelist filter!
* @param string $element
* @param array $attribs
+ * @param array|null $data
* @return bool
*/
public function checkSvgScriptCallback( $element, $attribs, $data = null ) {
* @return bool
*/
public function checkSvgScriptCallback( $element, $attribs, $data = null ) {
* (should replace it eventually).
*
* @param FileRepo $repo
* (should replace it eventually).
*
* @param FileRepo $repo
- * @param User $user (default null)
+ * @param User|null $user
*/
public function __construct( FileRepo $repo, $user = null ) {
// this might change based on wiki's configuration.
*/
public function __construct( FileRepo $repo, $user = null ) {
// this might change based on wiki's configuration.
* database, along with other metadata.
*
* @param string $path Path to file you want stashed
* database, along with other metadata.
*
* @param string $path Path to file you want stashed
- * @param string $sourceType The type of upload that generated this file
+ * @param string|null $sourceType The type of upload that generated this file
* (currently, I believe, 'file' or null)
* @throws UploadStashBadPathException
* @throws UploadStashFileException
* (currently, I believe, 'file' or null)
* @throws UploadStashBadPathException
* @throws UploadStashFileException
/**
* @param string|array|MessageSpecifier $messageSpec See Message::newFromSpecifier
* @param int $code Exception code
/**
* @param string|array|MessageSpecifier $messageSpec See Message::newFromSpecifier
* @param int $code Exception code
- * @param Exception|Throwable $previous The previous exception used for the exception chaining.
+ * @param Exception|Throwable|null $previous The previous exception used for the exception
+ * chaining.
*/
public function __construct( $messageSpec, $code = 0, $previous = null ) {
$this->messageSpec = $messageSpec;
*/
public function __construct( $messageSpec, $code = 0, $previous = null ) {
$this->messageSpec = $messageSpec;
*
* @since 1.29 Fourth argument for displayPassword removed.
* @param User $performingUser The user that does the password reset
*
* @since 1.29 Fourth argument for displayPassword removed.
* @param User $performingUser The user that does the password reset
- * @param string $username The user whose password is reset
- * @param string $email Alternative way to specify the user
+ * @param string|null $username The user whose password is reset
+ * @param string|null $email Alternative way to specify the user
* @return StatusValue Will contain the passwords as a username => password array if the
* $displayPassword flag was set
* @throws LogicException When the user is not allowed to perform the action
* @return StatusValue Will contain the passwords as a username => password array if the
* $displayPassword flag was set
* @throws LogicException When the user is not allowed to perform the action
* will be loaded once more from the database when accessing them.
*
* @param stdClass $row A row from the user table
* will be loaded once more from the database when accessing them.
*
* @param stdClass $row A row from the user table
- * @param array $data Further data to load into the object (see User::loadFromRow for valid keys)
+ * @param array|null $data Further data to load into the object
+ * (see User::loadFromRow for valid keys)
* @return User
*/
public static function newFromRow( $row, $data = null ) {
* @return User
*/
public static function newFromRow( $row, $data = null ) {
* @param string|array $groups A single group name or an array of group names
* @param int $limit Max number of users to return. The actual limit will never exceed 5000
* records; larger values are ignored.
* @param string|array $groups A single group name or an array of group names
* @param int $limit Max number of users to return. The actual limit will never exceed 5000
* records; larger values are ignored.
- * @param int $after ID the user to start after
+ * @param int|null $after ID the user to start after
* @return UserArrayFromResult
*/
public static function findUsersByGroup( $groups, $limit = 5000, $after = null ) {
* @return UserArrayFromResult
*/
public static function findUsersByGroup( $groups, $limit = 5000, $after = null ) {
* Initialize this object from a row from the user table.
*
* @param stdClass $row Row from the user table to load.
* Initialize this object from a row from the user table.
*
* @param stdClass $row Row from the user table to load.
- * @param array $data Further user data to load into the object
+ * @param array|null $data Further user data to load into the object
*
* user_groups Array of arrays or stdClass result rows out of the user_groups
* table. Previously you were supposed to pass an array of strings
*
* user_groups Array of arrays or stdClass result rows out of the user_groups
* table. Previously you were supposed to pass an array of strings
/**
* Update the 'You have new messages!' status.
* @param bool $val Whether the user has new messages
/**
* Update the 'You have new messages!' status.
* @param bool $val Whether the user has new messages
- * @param Revision $curRev New, as yet unseen revision of the user talk
+ * @param Revision|null $curRev New, as yet unseen revision of the user talk
* page. Ignored if null or !$val.
*/
public function setNewtalk( $val, $curRev = null ) {
* page. Ignored if null or !$val.
*/
public function setNewtalk( $val, $curRev = null ) {
* Get the user's current setting for a given option.
*
* @param string $oname The option to check
* Get the user's current setting for a given option.
*
* @param string $oname The option to check
- * @param string|array $defaultOverride A default value returned if the option does not exist
+ * @param string|array|null $defaultOverride A default value returned if the option does not exist
* @param bool $ignoreHidden Whether to ignore the effects of $wgHiddenPrefs
* @return string|array|int|null User's current value for the option
* @see getBoolOption()
* @param bool $ignoreHidden Whether to ignore the effects of $wgHiddenPrefs
* @return string|array|int|null User's current value for the option
* @see getBoolOption()
*
* @see User::listOptionKinds
* @param IContextSource $context
*
* @see User::listOptionKinds
* @param IContextSource $context
- * @param array $options Assoc. array with options keys to check as keys.
+ * @param array|null $options Assoc. array with options keys to check as keys.
* Defaults to $this->mOptions.
* @return array The key => kind mapping data
*/
* Defaults to $this->mOptions.
* @return array The key => kind mapping data
*/
* never expire.)
*
* @param string $group Name of the group to add
* never expire.)
*
* @param string $group Name of the group to add
- * @param string $expiry Optional expiry timestamp in any format acceptable to
+ * @param string|null $expiry Optional expiry timestamp in any format acceptable to
* wfTimestamp(), or null if the group assignment should not expire
* @return bool
*/
* wfTimestamp(), or null if the group assignment should not expire
* @return bool
*/
*
* @param WebRequest|null $request WebRequest object to use; $wgRequest will be used if null
* is passed.
*
* @param WebRequest|null $request WebRequest object to use; $wgRequest will be used if null
* is passed.
- * @param bool $secure Whether to force secure/insecure cookies or use default
+ * @param bool|null $secure Whether to force secure/insecure cookies or use default
* @param bool $rememberMe Whether to add a Token cookie for elongated sessions
*/
public function setCookies( $request = null, $secure = null, $rememberMe = false ) {
* @param bool $rememberMe Whether to add a Token cookie for elongated sessions
*/
public function setCookies( $request = null, $secure = null, $rememberMe = false ) {
* @param string $val Input value to compare
* @param string|array $salt Optional function-specific data for hashing
* @param WebRequest|null $request Object to use or null to use $wgRequest
* @param string $val Input value to compare
* @param string|array $salt Optional function-specific data for hashing
* @param WebRequest|null $request Object to use or null to use $wgRequest
- * @param int $maxage Fail tokens older than this, in seconds
+ * @param int|null $maxage Fail tokens older than this, in seconds
* @return bool Whether the token matches
*/
public function matchEditToken( $val, $salt = '', $request = null, $maxage = null ) {
* @return bool Whether the token matches
*/
public function matchEditToken( $val, $salt = '', $request = null, $maxage = null ) {
* @param string $val Input value to compare
* @param string|array $salt Optional function-specific data for hashing
* @param WebRequest|null $request Object to use or null to use $wgRequest
* @param string $val Input value to compare
* @param string|array $salt Optional function-specific data for hashing
* @param WebRequest|null $request Object to use or null to use $wgRequest
- * @param int $maxage Fail tokens older than this, in seconds
+ * @param int|null $maxage Fail tokens older than this, in seconds
* @return bool Whether the token matches
*/
public function matchEditTokenNoSuffix( $val, $salt = '', $request = null, $maxage = null ) {
* @return bool Whether the token matches
*/
public function matchEditTokenNoSuffix( $val, $salt = '', $request = null, $maxage = null ) {
* @param string $body Message body
* @param User|null $from Optional sending user; if unspecified, default
* $wgPasswordSender will be used.
* @param string $body Message body
* @param User|null $from Optional sending user; if unspecified, default
* $wgPasswordSender will be used.
- * @param string $replyto Reply-To address
+ * @param string|null $replyto Reply-To address
* @return Status
*/
public function sendMail( $subject, $body, $from = null, $replyto = null ) {
* @return Status
*/
public function sendMail( $subject, $body, $from = null, $replyto = null ) {
/**
* Load the user options either from cache, the database or an array
*
/**
* Load the user options either from cache, the database or an array
*
- * @param array $data Rows for the current user out of the user_properties table
+ * @param array|null $data Rows for the current user out of the user_properties table
*/
protected function loadOptions( $data = null ) {
global $wgContLang;
*/
protected function loadOptions( $data = null ) {
global $wgContLang;
/**
* @param int $userId The ID of the user who belongs to the group
/**
* @param int $userId The ID of the user who belongs to the group
- * @param string $group The internal group name
+ * @param string|null $group The internal group name
* @param string|null $expiry Timestamp of expiry in TS_MW format, or null if no expiry
*/
public function __construct( $userId = 0, $group = null, $expiry = null ) {
* @param string|null $expiry Timestamp of expiry in TS_MW format, or null if no expiry
*/
public function __construct( $userId = 0, $group = null, $expiry = null ) {
private $ipAddresses = [ '0.0.0.0/0', '::/0' ];
/**
private $ipAddresses = [ '0.0.0.0/0', '::/0' ];
/**
- * @param array $restrictions
+ * @param array|null $restrictions
* @throws InvalidArgumentException
*/
protected function __construct( array $restrictions = null ) {
* @throws InvalidArgumentException
*/
protected function __construct( array $restrictions = null ) {
* in the file to satisfy the request, an exception will be thrown.
*
* @param int $start The byte offset of the start of the block.
* in the file to satisfy the request, an exception will be thrown.
*
* @param int $start The byte offset of the start of the block.
- * @param int $length The number of bytes to return. If omitted, the remainder
+ * @param int|null $length The number of bytes to return. If omitted, the remainder
* of the file will be returned.
*
* @return string
* of the file will be returned.
*
* @return string
* @since 1.31
*
* @param User $user
* @since 1.31
*
* @param User $user
- * @param int $unreadLimit
+ * @param int|null $unreadLimit
*
* @return int|bool The number of unread notifications
* true if greater than or equal to $unreadLimit
*
* @return int|bool The number of unread notifications
* true if greater than or equal to $unreadLimit
/**
* Parse rules and flags.
/**
* Parse rules and flags.
- * @param string $variant Variant language code
+ * @param string|null $variant Variant language code
*/
public function parse( $variant = null ) {
if ( !$variant ) {
*/
public function parse( $variant = null ) {
if ( !$variant ) {
* @param string $ts 14-character timestamp
* YYYYMMDDHHMMSS
* 01234567890123
* @param string $ts 14-character timestamp
* YYYYMMDDHHMMSS
* 01234567890123
- * @param DateTimeZone $zone Timezone of $ts
+ * @param DateTimeZone|null $zone Timezone of $ts
* @param int &$ttl The amount of time (in seconds) the output may be cached for.
* Only makes sense if $ts is the current time.
* @todo handling of "o" format character for Iranian, Hebrew, Hijri & Thai?
* @param int &$ttl The amount of time (in seconds) the output may be cached for.
* Only makes sense if $ts is the current time.
* @todo handling of "o" format character for Iranian, Hebrew, Hijri & Thai?
* match up with it.
*
* @param string $str The validated block duration in English
* match up with it.
*
* @param string $str The validated block duration in English
- * @param User $user User object to use timezone from or null for $wgUser
+ * @param User|null $user User object to use timezone from or null for $wgUser
* @param int $now Current timestamp, for formatting relative block durations
* @return string Somehow translated block duration
* @see LanguageFi.php for example implementation
* @param int $now Current timestamp, for formatting relative block durations
* @return string Somehow translated block duration
* @see LanguageFi.php for example implementation
/**
* Validate the variant
/**
* Validate the variant
- * @param string $variant The variant to validate
+ * @param string|null $variant The variant to validate
* @return mixed Returns the variant if it is valid, null otherwise
*/
public function validateVariant( $variant = null ) {
* @return mixed Returns the variant if it is valid, null otherwise
*/
public function validateVariant( $variant = null ) {
- * @param User $user User object to use timezone from or null for $wgUser
+ * @param User|null $user User object to use timezone from or null for $wgUser
* @param int $now Current timestamp, for formatting relative block durations
* @return string
*/
* @param int $now Current timestamp, for formatting relative block durations
* @return string
*/
* this will return an array.
*
* @param string $name The name of the param
* this will return an array.
*
* @param string $name The name of the param
- * @param mixed $default Anything you want, default null
+ * @param mixed|null $default Anything you want, default null
* @return mixed
*/
protected function getOption( $name, $default = null ) {
* @return mixed
*/
protected function getOption( $name, $default = null ) {
/**
* Get an argument.
* @param int $argId The integer value (from zero) for the arg
/**
* Get an argument.
* @param int $argId The integer value (from zero) for the arg
- * @param mixed $default The default if it doesn't exist
+ * @param mixed|null $default The default if it doesn't exist
* @return mixed
*/
protected function getArg( $argId = 0, $default = null ) {
* @return mixed
*/
protected function getArg( $argId = 0, $default = null ) {
/**
* Return input from stdin.
/**
* Return input from stdin.
- * @param int $len The number of bytes to read. If null, just return the handle.
+ * @param int|null $len The number of bytes to read. If null, just return the handle.
* Maintenance::STDIN_ALL returns the full length
* @return mixed
*/
* Maintenance::STDIN_ALL returns the full length
* @return mixed
*/
* Throw some output to the user. Scripts can call this with no fears,
* as we handle all --quiet stuff here
* @param string $out The text to show to the user
* Throw some output to the user. Scripts can call this with no fears,
* as we handle all --quiet stuff here
* @param string $out The text to show to the user
- * @param mixed $channel Unique identifier for the channel. See function outputChanneled.
+ * @param mixed|null $channel Unique identifier for the channel. See function outputChanneled.
*/
protected function output( $out, $channel = null ) {
// This is sometimes called very early, before Setup.php is included.
*/
protected function output( $out, $channel = null ) {
// This is sometimes called very early, before Setup.php is included.
* same channel are concatenated, but any intervening messages in another
* channel start a new line.
* @param string $msg The message without trailing newline
* same channel are concatenated, but any intervening messages in another
* channel start a new line.
* @param string $msg The message without trailing newline
- * @param string $channel Channel identifier or null for no
+ * @param string|null $channel Channel identifier or null for no
* channel. Channel comparison uses ===.
*/
public function outputChanneled( $msg, $channel = null ) {
* channel. Channel comparison uses ===.
*/
public function outputChanneled( $msg, $channel = null ) {
* Run a child maintenance script. Pass all of the current arguments
* to it.
* @param string $maintClass A name of a child maintenance class
* Run a child maintenance script. Pass all of the current arguments
* to it.
* @param string $maintClass A name of a child maintenance class
- * @param string $classFile Full path of where the child is
+ * @param string|null $classFile Full path of where the child is
* @return Maintenance
*/
public function runChild( $maintClass, $classFile = null ) {
* @return Maintenance
*/
public function runChild( $maintClass, $classFile = null ) {
* $mOptions becomes an array with keys set to the option names
* $mArgs becomes a zero-based array containing the non-option arguments
*
* $mOptions becomes an array with keys set to the option names
* $mArgs becomes a zero-based array containing the non-option arguments
*
- * @param string $self The name of the script, if any
- * @param array $opts An array of options, in form of key=>value
- * @param array $args An array of command line arguments
+ * @param string|null $self The name of the script, if any
+ * @param array|null $opts An array of options, in form of key=>value
+ * @param array|null $args An array of command line arguments
*/
public function loadParamsAndArgs( $self = null, $opts = null, $args = null ) {
# If we were given opts or args, set those and return early
*/
public function loadParamsAndArgs( $self = null, $opts = null, $args = null ) {
# If we were given opts or args, set those and return early
private $stubText = false; // include rev_text_id instead of text; for 2-pass dump
/**
private $stubText = false; // include rev_text_id instead of text; for 2-pass dump
/**
- * @param array $args For backward compatibility
+ * @param array|null $args For backward compatibility
*/
function __construct( $args = null ) {
parent::__construct();
*/
function __construct( $args = null ) {
parent::__construct();
- * @param array $args For backward compatibility
+ * @param array|null $args For backward compatibility
*/
function __construct( $args = null ) {
parent::__construct();
*/
function __construct( $args = null ) {
parent::__construct();
/**
* Get a Parser object
*
/**
* Get a Parser object
*
- * @param string $preprocessor
+ * @param string|null $preprocessor
* @return Parser
*/
function getParser( $preprocessor = null ) {
* @return Parser
*/
function getParser( $preprocessor = null ) {
"PhanTypeMismatchArgument",
// approximate error count: 13
"PhanTypeMismatchArgumentInternal",
"PhanTypeMismatchArgument",
// approximate error count: 13
"PhanTypeMismatchArgumentInternal",
- // approximate error count: 6
- "PhanTypeMismatchDeclaredParam",
- // approximate error count: 111
- "PhanTypeMismatchDeclaredParamNullable",
// approximate error count: 5
"PhanTypeMismatchDimAssignment",
// approximate error count: 2
// approximate error count: 5
"PhanTypeMismatchDimAssignment",
// approximate error count: 2
*
* @param array|string $pairs Key to the global variable, or an array
* of key/value pairs.
*
* @param array|string $pairs Key to the global variable, or an array
* of key/value pairs.
- * @param mixed $value Value to set the global to (ignored
+ * @param mixed|null $value Value to set the global to (ignored
* if an array is given as first argument).
*
* @note To allow changes to global variables to take effect on global service instances,
* if an array is given as first argument).
*
* @note To allow changes to global variables to take effect on global service instances,
- * @param Config $configOverrides Configuration overrides for the new MediaWikiServices instance.
+ * @param Config|null $configOverrides Configuration overrides for the new MediaWikiServices
+ * instance.
* @param callable[] $services An associative array of services to re-define. Keys are service
* names, values are callables.
*
* @param callable[] $services An associative array of services to re-define. Keys are service
* names, values are callables.
*
* in which case the next two parameters are ignored; or a single string
* identifying a group, to use with the next two parameters.
* @param string|null $newKey
* in which case the next two parameters are ignored; or a single string
* identifying a group, to use with the next two parameters.
* @param string|null $newKey
- * @param mixed $newValue
+ * @param mixed|null $newValue
*/
public function setGroupPermissions( $newPerms, $newKey = null, $newValue = null ) {
global $wgGroupPermissions;
*/
public function setGroupPermissions( $newPerms, $newKey = null, $newValue = null ) {
global $wgGroupPermissions;
* @since 1.25 ($namespace in 1.28)
* @param string|Title $pageName Page name or title
* @param string $text Page's content
* @since 1.25 ($namespace in 1.28)
* @param string|Title $pageName Page name or title
* @param string $text Page's content
- * @param int $namespace Namespace id (name cannot already contain namespace)
- * @param User $user If null, static::getTestSysop()->getUser() is used.
+ * @param int|null $namespace Namespace id (name cannot already contain namespace)
+ * @param User|null $user If null, static::getTestSysop()->getUser() is used.
* @return array Title object and page id
*/
protected function insertPage(
* @return array Title object and page id
*/
protected function insertPage(
* Otherwise, it will clone the tables and change the prefix.
*
* @param IMaintainableDatabase $db Database to use
* Otherwise, it will clone the tables and change the prefix.
*
* @param IMaintainableDatabase $db Database to use
- * @param string $prefix Prefix to use for test tables. If not given, the prefix is determined
+ * @param string|null $prefix Prefix to use for test tables. If not given, the prefix is determined
* automatically for $db.
* @return bool True if tables were cloned, false if only the prefix was changed
*/
* automatically for $db.
* @return bool True if tables were cloned, false if only the prefix was changed
*/
/**
* @param bool $collect Whether to collect logs. @see setCollect()
/**
* @param bool $collect Whether to collect logs. @see setCollect()
- * @param callable $filter Filter logs before collecting/printing. Signature is
+ * @param callable|null $filter Filter logs before collecting/printing. Signature is
* string|null function ( string $message, string $level, array $context );
* @param bool $collectContext Whether to keep the context passed to log
* (since 1.29, @see setCollectContext()).
* string|null function ( string $message, string $level, array $context );
* @param bool $collectContext Whether to keep the context passed to log
* (since 1.29, @see setCollectContext()).
*
* @param int $number Number of filenames to write
* @param string $format Optional, must be understood by ImageMagick, such as 'jpg' or 'gif'
*
* @param int $number Number of filenames to write
* @param string $format Optional, must be understood by ImageMagick, such as 'jpg' or 'gif'
- * @param string $dir Directory, optional (will default to current working directory)
+ * @param string|null $dir Directory, optional (will default to current working directory)
* @return array Filenames we just wrote
*/
function writeImages( $number, $format = 'jpg', $dir = null ) {
* @return array Filenames we just wrote
*/
function writeImages( $number, $format = 'jpg', $dir = null ) {
* Checks that the request's result matches the expected results.
* Assumes no rawcontinue and a complete batch.
* @param array $values Array is a two element array( request, expected_results )
* Checks that the request's result matches the expected results.
* Assumes no rawcontinue and a complete batch.
* @param array $values Array is a two element array( request, expected_results )
- * @param array $session
+ * @param array|null $session
* @param bool $appendModule
* @param bool $appendModule
+ * @param User|null $user
*/
protected function check( $values, array $session = null,
$appendModule = false, User $user = null
*/
protected function check( $values, array $session = null,
$appendModule = false, User $user = null
*
* File must be in the path returned by getFilePath()
* @param string $name File name
*
* File must be in the path returned by getFilePath()
* @param string $name File name
- * @param string $type MIME type [optional]
+ * @param string|null $type MIME type [optional]
* @return UnregisteredLocalFile
*/
protected function dataFile( $name, $type = null ) {
* @return UnregisteredLocalFile
*/
protected function dataFile( $name, $type = null ) {
/**
* @param string|Title|WikiPage $page
* @param string $text
/**
* @param string|Title|WikiPage $page
* @param string $text
+ * @param int|null $model
/**
* If you need a Session for testing but don't want to create a backend to
* construct one, use this.
/**
* If you need a Session for testing but don't want to create a backend to
* construct one, use this.
- * @param object $backend Object to serve as the SessionBackend
+ * @param object|null $backend Object to serve as the SessionBackend
- * @param LoggerInterface $logger
+ * @param LoggerInterface|null $logger
* @return Session
*/
public static function getDummySession( $backend = null, $index = -1, $logger = null ) {
* @return Session
*/
public static function getDummySession( $backend = null, $index = -1, $logger = null ) {
/**
* @param Title $title
/**
* @param Title $title
- * @param int $revId Unused.
+ * @param int|null $revId Unused.
* @param null|ParserOptions $options
* @param bool $generateHtml Whether to generate Html (default: true). If false, the result
* of calling getText() on the ParserOutput object returned by this method is undefined.
* @param null|ParserOptions $options
* @param bool $generateHtml Whether to generate Html (default: true). If false, the result
* of calling getText() on the ParserOutput object returned by this method is undefined.
* @see ContentHandler::serializeContent
*
* @param Content $content
* @see ContentHandler::serializeContent
*
* @param Content $content
- * @param string $format
+ * @param string|null $format
* @see ContentHandler::unserializeContent
*
* @param string $blob
* @see ContentHandler::unserializeContent
*
* @param string $blob
- * @param string $format Unused.
+ * @param string|null $format Unused.
/**
* @param Title $title
/**
* @param Title $title
- * @param int $revId Unused.
+ * @param int|null $revId Unused.
* @param null|ParserOptions $options
* @param bool $generateHtml Whether to generate Html (default: true). If false, the result
* of calling getText() on the ParserOutput object returned by this method is undefined.
* @param null|ParserOptions $options
* @param bool $generateHtml Whether to generate Html (default: true). If false, the result
* of calling getText() on the ParserOutput object returned by this method is undefined.
* @see ContentHandler::serializeContent
*
* @param Content $content
* @see ContentHandler::serializeContent
*
* @param Content $content
- * @param string $format
+ * @param string|null $format
* @see ContentHandler::unserializeContent
*
* @param string $blob
* @see ContentHandler::unserializeContent
*
* @param string $blob
- * @param string $format Unused.
+ * @param string|null $format Unused.
* @see ContentHandler::unserializeContent
*
* @param string $blob
* @see ContentHandler::unserializeContent
*
* @param string $blob
- * @param string $format
+ * @param string|null $format
*
* @param int $status
* @param string $msgHtml HTML
*
* @param int $status
* @param string $msgHtml HTML
- * @param string $msgText Short error description, for internal logging. Defaults to $msgHtml.
+ * @param string|null $msgText Short error description, for internal logging. Defaults to $msgHtml.
* Only used for HTTP 500 errors.
* @param array $context Error context, for internal logging. Only used for HTTP 500 errors.
* @return void
* Only used for HTTP 500 errors.
* @param array $context Error context, for internal logging. Only used for HTTP 500 errors.
* @return void