/**
* Get the description of this item without any escaping
*
+ * @return string
*/
public function getDescriptionUnescaped() {
return $this->description;
/**
* @param array $formData
* @param PreferencesForm $form
+ * @return Status
*/
public static function tryUISubmit( $formData, $form ) {
$preferencesFactory = self::getDefaultPreferencesFactory();
}
/**
- * @param bool|string $wikiId The ID of the target wiki database. Use false for the local wiki.
+ * @param bool|string $wiki The ID of the target wiki database. Use false for the local wiki.
*
* @return SqlBlobStore
*/
/**
* MCR migration note: this replaces Revision::isUnpatrolled
*
+ * @param RevisionRecord $rev
* @return int Rcid of the unpatrolled row, zero if there isn't one
*/
public function isUnpatrolled( RevisionRecord $rev ) {
*
* @param string $list Correctly formatted text (newline delimited) to be
* used to generate the options.
- * @param array $params Extra parameters
- * @param string $params['other'] If set, add an option with this as text and a value of 'other'
+ * @param array $params Extra parameters:
+ * - string $params['other'] If set, add an option with this as text and a value of 'other'
* @return array Array keys are textual labels, values are internal values
*/
public static function listDropDownOptions( $list, $params = [] ) {
}
/**
- * @param string $index
* @return string
* @since 1.16.3
*/
$this->asyncHandler = isset( $params['asyncHandler'] ) ? $params['asyncHandler'] : null;
}
+ /**
+ * @param LoggerInterface $logger
+ */
public function setLogger( LoggerInterface $logger ) {
$this->logger = $logger;
}
* @param string $key
* @param bool $versioned
* @param float $minTime
- * @param mixed $asOf
+ * @param mixed &$asOf
* @return mixed
*/
protected function getInterimValue( $key, $versioned, $minTime, &$asOf ) {
/** @var LinkRenderer */
protected $linkRenderer;
+ /**
+ * @param Config $config
+ * @param Language $contLang
+ * @param AuthManager $authManager
+ * @param LinkRenderer $linkRenderer
+ */
public function __construct(
Config $config,
Language $contLang,
*
* @since 1.28
* @param ResourceLoaderContext $context
- * @param string[] $modules List of module names
* @return string Hash
*/
public function makeVersionQuery( ResourceLoaderContext $context ) {
/**
* @param int $exitCode
* @param string $stdout
+ * @param string|null $stderr
*/
public function __construct( $exitCode, $stdout, $stderr = null ) {
$this->exitCode = $exitCode;
/**
* Replace some globals to make sure the fact that the user has just been logged in is
* reflected in the current request.
- * @param User $user
*/
protected function setSessionUserForCurrentRequest() {
global $wgUser, $wgLang;
$this->revisionGetTimestampFromIdCallback = [ 'Revision', 'getTimestampFromId' ];
}
+ /**
+ * @param StatsdDataFactoryInterface $stats
+ */
public function setStatsdDataFactory( StatsdDataFactoryInterface $stats ) {
$this->stats = $stats;
}
/**
* @since 1.31
+ * @param User $user
+ * @return int
*/
public function countWatchedItems( User $user ) {
$dbr = $this->getConnectionRef( DB_REPLICA );
/**
* @since 1.27
+ * @param LinkTarget $target
+ * @return int
*/
public function countWatchers( LinkTarget $target ) {
$dbr = $this->getConnectionRef( DB_REPLICA );
/**
* @since 1.27
+ * @param LinkTarget $target
+ * @param string|int $threshold
+ * @return int
*/
public function countVisitingWatchers( LinkTarget $target, $threshold ) {
$dbr = $this->getConnectionRef( DB_REPLICA );
/**
* @since 1.27
+ * @param LinkTarget[] $targets
+ * @param array $options
+ * @return array
*/
public function countWatchersMultiple( array $targets, array $options = [] ) {
$dbOptions = [ 'GROUP BY' => [ 'wl_namespace', 'wl_title' ] ];
/**
* @since 1.27
+ * @param array $targetsWithVisitThresholds
+ * @param int|null $minimumWatchers
+ * @return array
*/
public function countVisitingWatchersMultiple(
array $targetsWithVisitThresholds,
/**
* @since 1.27
+ * @param User $user
+ * @param LinkTarget $target
+ * @return bool
*/
public function getWatchedItem( User $user, LinkTarget $target ) {
if ( $user->isAnon() ) {
/**
* @since 1.27
+ * @param User $user
+ * @param LinkTarget $target
+ * @return bool
*/
public function loadWatchedItem( User $user, LinkTarget $target ) {
// Only loggedin user can have a watchlist
/**
* @since 1.27
+ * @param User $user
+ * @param array $options
+ * @return WatchedItem[]
*/
public function getWatchedItemsForUser( User $user, array $options = [] ) {
$options += [ 'forWrite' => false ];
/**
* @since 1.27
+ * @param User $user
+ * @param LinkTarget $target
+ * @return bool
*/
public function isWatched( User $user, LinkTarget $target ) {
return (bool)$this->getWatchedItem( $user, $target );
/**
* @since 1.27
+ * @param User $user
+ * @param LinkTarget[] $targets
+ * @return array
*/
public function getNotificationTimestampsBatch( User $user, array $targets ) {
$timestamps = [];
/**
* @since 1.27
+ * @param User $user
+ * @param LinkTarget $target
*/
public function addWatch( User $user, LinkTarget $target ) {
$this->addWatchBatchForUser( $user, [ $target ] );
/**
* @since 1.27
+ * @param User $user
+ * @param LinkTarget[] $targets
+ * @return bool
*/
public function addWatchBatchForUser( User $user, array $targets ) {
if ( $this->readOnlyMode->isReadOnly() ) {
/**
* @since 1.27
+ * @param User $user
+ * @param LinkTarget $target
+ * @return bool
*/
public function removeWatch( User $user, LinkTarget $target ) {
// Only logged in user can have a watchlist
/**
* @since 1.27
+ * @param User $user
+ * @param string|int $timestamp
+ * @param LinkTarget[] $targets
+ * @return bool
*/
public function setNotificationTimestampsForUser( User $user, $timestamp, array $targets = [] ) {
// Only loggedin user can have a watchlist
/**
* @since 1.27
+ * @param User $editor
+ * @param LinkTarget $target
+ * @param string|int $timestamp
+ * @return int
*/
public function updateNotificationTimestamp( User $editor, LinkTarget $target, $timestamp ) {
$dbw = $this->getConnectionRef( DB_MASTER );
/**
* @since 1.27
+ * @param User $user
+ * @param Title $title
+ * @param string $force
+ * @param int $oldid
+ * @return bool
*/
public function resetNotificationTimestamp( User $user, Title $title, $force = '', $oldid = 0 ) {
// Only loggedin user can have a watchlist
/**
* @since 1.27
+ * @param User $user
+ * @param int|null $unreadLimit
+ * @return int|bool
*/
public function countUnreadNotifications( User $user, $unreadLimit = null ) {
$queryOptions = [];
/**
* @since 1.27
+ * @param LinkTarget $oldTarget
+ * @param LinkTarget $newTarget
*/
public function duplicateAllAssociatedEntries( LinkTarget $oldTarget, LinkTarget $newTarget ) {
$oldTarget = Title::newFromLinkTarget( $oldTarget );
/**
* @since 1.27
+ * @param LinkTarget $oldTarget
+ * @param LinkTarget $newTarget
*/
public function duplicateEntry( LinkTarget $oldTarget, LinkTarget $newTarget ) {
$dbw = $this->getConnectionRef( DB_MASTER );
/**
* @param array $config Configuration options
- * @param array $config['namespace'] Configuration for the NamespaceInputWidget
- * dropdown with list of namespaces
- * @param string $config['namespace']['includeAllValue'] If specified,
- * add an "all namespaces" option to the dropdown, and use this as the input value for it
- * @param array|null $config['invert'] Configuration for the "invert selection"
- * CheckboxInputWidget. If null, the checkbox will not be generated.
- * @param array|null $config['associated'] Configuration for the "include associated namespace"
- * CheckboxInputWidget. If null, the checkbox will not be generated.
- * @param array $config['invertLabel'] Configuration for the FieldLayout with label
- * wrapping the "invert selection" checkbox
- * @param string $config['invertLabel']['label'] Label text for the label
- * @param array $config['associatedLabel'] Configuration for the FieldLayout with label
- * wrapping the "include associated namespace" checkbox
- * @param string $config['associatedLabel']['label'] Label text for the label
+ * - array $config['namespace'] Configuration for the NamespaceInputWidget
+ * dropdown with list of namespaces
+ * - string $config['namespace']['includeAllValue'] If specified,
+ * add an "all namespaces" option to the dropdown, and use this as the input value for it
+ * - array|null $config['invert'] Configuration for the "invert selection"
+ * CheckboxInputWidget. If null, the checkbox will not be generated.
+ * - array|null $config['associated'] Configuration for the "include associated namespace"
+ * CheckboxInputWidget. If null, the checkbox will not be generated.
+ * - array $config['invertLabel'] Configuration for the FieldLayout with label
+ * wrapping the "invert selection" checkbox
+ * - string $config['invertLabel']['label'] Label text for the label
+ * - array $config['associatedLabel'] Configuration for the FieldLayout with label
+ * wrapping the "include associated namespace" checkbox
+ * - string $config['associatedLabel']['label'] Label text for the label
*/
public function __construct( array $config = [] ) {
// Configuration initialization
* Like TitleInputWidget, but the namespace has to be input through a separate dropdown field.
*
* @param array $config Configuration options
- * @param array $config['namespace'] Configuration for the NamespaceInputWidget dropdown
- * with list of namespaces
- * @param array $config['title'] Configuration for the TitleInputWidget text field
+ * - array $config['namespace'] Configuration for the NamespaceInputWidget dropdown
+ * with list of namespaces
+ * - array $config['title'] Configuration for the TitleInputWidget text field
*/
public function __construct( array $config = [] ) {
// Configuration initialization
/**
* @param array $config Configuration options
- * @param string $config['inputFormat'] Date format string to use for the textual input field.
- * Displayed while the widget is active, and the user can type in a date in this format.
- * Should be short and easy to type. (default: 'YYYY-MM-DD' or 'YYYY-MM', depending on
- * `precision`)
- * @param string $config['displayFormat'] Date format string to use for the clickable label.
- * while the widget is inactive. Should be as unambiguous as possible (for example, prefer
- * to spell out the month, rather than rely on the order), even if that makes it longer.
- * Applicable only if the widget is infused. (default: language-specific)
- * @param string $config['longDisplayFormat'] If a custom displayFormat is not specified, use
- * unabbreviated day of the week and month names in the default language-specific
- * displayFormat. (default: false)
- * @param string $config['placeholderLabel'] Placeholder text shown when the widget is not
- * selected. Applicable only if the widget is infused. (default: taken from message
- * `mw-widgets-dateinput-no-date`)
- * @param string $config['placeholderDateFormat'] User-visible date format string displayed
- * in the textual input field when it's empty. Should be the same as `inputFormat`, but
- * translated to the user's language. (default: 'YYYY-MM-DD' or 'YYYY-MM', depending on
- * `precision`)
- * @param string $config['precision'] Date precision to use, 'day' or 'month' (default: 'day')
- * @param string $config['mustBeAfter'] Validates the date to be after this.
- * In the 'YYYY-MM-DD' or 'YYYY-MM' format, depending on `precision`.
- * @param string $config['mustBeBefore'] Validates the date to be before this.
- * In the 'YYYY-MM-DD' or 'YYYY-MM' format, depending on `precision`.
+ * - string $config['inputFormat'] Date format string to use for the textual input field.
+ * Displayed while the widget is active, and the user can type in a date in this format.
+ * Should be short and easy to type. (default: 'YYYY-MM-DD' or 'YYYY-MM', depending on
+ * `precision`)
+ * - string $config['displayFormat'] Date format string to use for the clickable label.
+ * while the widget is inactive. Should be as unambiguous as possible (for example, prefer
+ * to spell out the month, rather than rely on the order), even if that makes it longer.
+ * Applicable only if the widget is infused. (default: language-specific)
+ * - string $config['longDisplayFormat'] If a custom displayFormat is not specified, use
+ * unabbreviated day of the week and month names in the default language-specific
+ * displayFormat. (default: false)
+ * - string $config['placeholderLabel'] Placeholder text shown when the widget is not
+ * selected. Applicable only if the widget is infused. (default: taken from message
+ * `mw-widgets-dateinput-no-date`)
+ * - string $config['placeholderDateFormat'] User-visible date format string displayed
+ * in the textual input field when it's empty. Should be the same as `inputFormat`, but
+ * translated to the user's language. (default: 'YYYY-MM-DD' or 'YYYY-MM', depending on
+ * `precision`)
+ * - string $config['precision'] Date precision to use, 'day' or 'month' (default: 'day')
+ * - string $config['mustBeAfter'] Validates the date to be after this.
+ * In the 'YYYY-MM-DD' or 'YYYY-MM' format, depending on `precision`.
+ * - string $config['mustBeBefore'] Validates the date to be before this.
+ * In the 'YYYY-MM-DD' or 'YYYY-MM' format, depending on `precision`.
*/
public function __construct( array $config = [] ) {
$config = array_merge( [
/**
* @param array $config Configuration options
- * @param string $config['type'] 'date', 'time', or 'datetime'
- * @param string $config['min'] Minimum date, time, or datetime
- * @param string $config['max'] Maximum date, time, or datetime
- * @param bool $config['clearable'] Whether to provide for blanking the value.
+ * - string $config['type'] 'date', 'time', or 'datetime'
+ * - string $config['min'] Minimum date, time, or datetime
+ * - string $config['max'] Maximum date, time, or datetime
+ * - bool $config['clearable'] Whether to provide for blanking the value.
*/
public function __construct( array $config = [] ) {
// We need $this->type set before calling the parent constructor
/**
* @param array $config Configuration options
- * @param string $config['includeAllValue'] If specified, add a "all namespaces" option to the
+ * - string $config['includeAllValue'] If specified, add a "all namespaces" option to the
* namespace dropdown, and use this as the input value for it
- * @param int[] $config['exclude'] List of namespace numbers to exclude from the selector
+ * - int[] $config['exclude'] List of namespace numbers to exclude from the selector
*/
public function __construct( array $config = [] ) {
// Configuration initialization
/**
* @param array $config Configuration options
- * @param int|null $config['pushPending'] Whether the input should be visually marked as
- * "pending", while requesting suggestions (default: false)
- * @param bool|null $config['performSearchOnClick'] If true, the script will start a search
- * whenever a user hits a suggestion. If false, the text of the suggestion is inserted into the
- * text field only (default: true)
- * @param string $config['dataLocation'] Where the search input field will be
- * used (header or content, default: header)
+ * - int|null $config['pushPending'] Whether the input should be visually marked as
+ * "pending", while requesting suggestions (default: false)
+ * - bool|null $config['performSearchOnClick'] If true, the script will start a search
+ * whenever a user hits a suggestion. If false, the text of the suggestion is inserted into
+ * the text field only (default: true)
+ * - string $config['dataLocation'] Where the search input field will be
+ * used (header or content, default: header)
*/
public function __construct( array $config = [] ) {
$config = array_merge( [
* A version of the SelectWithInputWidget, with `or` set to true.
*
* @param array $config Configuration options
- * @param array $config['textinput'] Configuration for the TextInputWidget
- * @param array $config['dropdowninput'] Configuration for the DropdownInputWidget
- * @param bool $config['or'] Configuration for whether the widget is dropdown AND input
+ * - array $config['textinput'] Configuration for the TextInputWidget
+ * - array $config['dropdowninput'] Configuration for the DropdownInputWidget
+ * - bool $config['or'] Configuration for whether the widget is dropdown AND input
* or dropdown OR input
*/
public function __construct( array $config = [] ) {
/**
* @param array $config Configuration options
- * @param int|null $config['namespace'] Namespace to prepend to queries
- * @param bool|null $config['relative'] If a namespace is set,
- * return a title relative to it (default: true)
- * @param bool|null $config['suggestions'] Display search suggestions (default: true)
- * @param bool|null $config['highlightFirst'] Automatically highlight
- * the first result (default: true)
- * @param bool|null $config['validateTitle'] Whether the input must
- * be a valid title (default: true)
+ * - int|null $config['namespace'] Namespace to prepend to queries
+ * - bool|null $config['relative'] If a namespace is set,
+ * return a title relative to it (default: true)
+ * - bool|null $config['suggestions'] Display search suggestions (default: true)
+ * - bool|null $config['highlightFirst'] Automatically highlight
+ * the first result (default: true)
+ * - bool|null $config['validateTitle'] Whether the input must
+ * be a valid title (default: true)
*/
public function __construct( array $config = [] ) {
parent::__construct(
/**
* @param array $config Configuration options
- * @param array $config['users'] Array of usernames to use as preset data
- * @param array $config['placeholder'] Placeholder message for input
- * @param array $config['name'] Name attribute (used in forms)
+ * - array $config['users'] Array of usernames to use as preset data
+ * - array $config['placeholder'] Placeholder message for input
+ * - array $config['name'] Name attribute (used in forms)
*/
public function __construct( array $config = [] ) {
parent::__construct( $config );