* @since 1.29
*/
class ChangesListBooleanFilter extends ChangesListFilter {
- /**
- * Name. Used as URL parameter
- *
- * @var string $name
- */
-
// This can sometimes be different on Special:RecentChanges
// and Special:Watchlist, due to the double-legacy hooks
// (SpecialRecentChangesFilters and SpecialWatchlistFilters)
* it's for.
*
* @param array $filterDefinition ChangesListFilter definition
- *
- * $filterDefinition['name'] string Name. Used as URL parameter.
- * $filterDefinition['group'] ChangesListFilterGroup Group. Filter group this
- * belongs to.
- * $filterDefinition['label'] string i18n key of label for structured UI.
- * $filterDefinition['description'] string i18n key of description for structured
- * UI.
- * $filterDefinition['showHide'] string Main i18n key used for unstructured UI.
- * $filterDefinition['isReplacedInStructuredUi'] bool Whether there is an
- * equivalent feature available in the structured UI; this is optional, defaulting
- * to true. It does not need to be set if the exact same filter is simply visible
- * on both.
- * $filterDefinition['default'] bool Default
- * $filterDefinition['priority'] int Priority integer. Higher value means higher
- * up in the group's filter list.
- * $filterDefinition['queryCallable'] callable Callable accepting parameters, used
- * to implement filter's DB query modification. Callback parameters:
- * string $specialPageClassName Class name of current special page
- * IContextSource $context Context, for e.g. user
- * IDatabase $dbr Database, for addQuotes, makeList, and similar
- * array &$tables Array of tables; see IDatabase::select $table
- * array &$fields Array of fields; see IDatabase::select $vars
- * array &$conds Array of conditions; see IDatabase::select $conds
- * array &$query_options Array of query options; see IDatabase::select $options
- * array &$join_conds Array of join conditions; see IDatabase::select $join_conds
- * Optional only for legacy filters that still use the query hooks directly
+ * * $filterDefinition['name'] string Name. Used as URL parameter.
+ * * $filterDefinition['group'] ChangesListFilterGroup Group. Filter group this
+ * belongs to.
+ * * $filterDefinition['label'] string i18n key of label for structured UI.
+ * * $filterDefinition['description'] string i18n key of description for structured
+ * UI.
+ * * $filterDefinition['showHide'] string Main i18n key used for unstructured UI.
+ * * $filterDefinition['isReplacedInStructuredUi'] bool Whether there is an
+ * equivalent feature available in the structured UI; this is optional, defaulting
+ * to true. It does not need to be set if the exact same filter is simply visible
+ * on both.
+ * * $filterDefinition['default'] bool Default
+ * * $filterDefinition['priority'] int Priority integer. Higher value means higher
+ * up in the group's filter list.
+ * * $filterDefinition['queryCallable'] callable Callable accepting parameters, used
+ * to implement filter's DB query modification. Required, except for legacy
+ * filters that still use the query hooks directly. Callback parameters:
+ * * string $specialPageClassName Class name of current special page
+ * * IContextSource $context Context, for e.g. user
+ * * IDatabase $dbr Database, for addQuotes, makeList, and similar
+ * * array &$tables Array of tables; see IDatabase::select $table
+ * * array &$fields Array of fields; see IDatabase::select $vars
+ * * array &$conds Array of conditions; see IDatabase::select $conds
+ * * array &$query_options Array of query options; see IDatabase::select $options
+ * * array &$join_conds Array of join conditions; see IDatabase::select $join_conds
*/
public function __construct( $filterDefinition ) {
parent::__construct( $filterDefinition );
/**
* Sets default
*
- * @param bool Default value
+ * @param bool $defaultValue
*/
public function setDefault( $defaultValue ) {
$this->defaultValue = $defaultValue;
* @param array $groupDefinition Configuration of group
* * $groupDefinition['name'] string Group name
* * $groupDefinition['title'] string i18n key for title (optional, can be omitted
- * * only if none of the filters in the group display in the structured UI)
+ * only if none of the filters in the group display in the structured UI)
* * $groupDefinition['priority'] int Priority integer. Higher means higher in the
- * * group list.
+ * group list.
* * $groupDefinition['filters'] array Numeric array of filter definitions, each of which
- * * is an associative array to be passed to the filter constructor. However,
- * * 'priority' is optional for the filters. Any filter that has priority unset
- * * will be put to the bottom, in the order given.
+ * is an associative array to be passed to the filter constructor. However,
+ * 'priority' is optional for the filters. Any filter that has priority unset
+ * will be put to the bottom, in the order given.
* * $groupDefinition['whatsThisHeader'] string i18n key for header of "What's
- * * This" popup (optional).
+ * This" popup (optional).
* * $groupDefinition['whatsThisBody'] string i18n key for body of "What's This"
- * * popup (optional).
+ * popup (optional).
* * $groupDefinition['whatsThisUrl'] string URL for main link of "What's This"
- * * popup (optional).
+ * popup (optional).
* * $groupDefinition['whatsThisLinkText'] string i18n key of text for main link of
- * * "What's This" popup (optional).
+ * "What's This" popup (optional).
*/
public function __construct( array $groupDefinition ) {
$groupDefinition['isFullCoverage'] = true;
protected $description;
/**
- * List of conflicting groups
+ * Array of associative arrays with conflict information. See
+ * setUnidirectionalConflict
*
- * @var array $conflictingGroups Array of associative arrays with conflict
- * information. See setUnidirectionalConflict
+ * @var array $conflictingGroups
*/
protected $conflictingGroups = [];
/**
- * List of conflicting filters
+ * Array of associative arrays with conflict information. See
+ * setUnidirectionalConflict
*
- * @var array $conflictingFilters Array of associative arrays with conflict
- * information. See setUnidirectionalConflict
+ * @var array $conflictingFilters
*/
protected $conflictingFilters = [];
/**
- * List of filters that are a subset of the current filter
+ * Array of associative arrays with subset information
*
- * @var array $subsetFilters Array of associative arrays with subset information
+ * @var array $subsetFilters
*/
protected $subsetFilters = [];
* UI it's for.
*
* @param array $filterDefinition ChangesListFilter definition
- *
- * $filterDefinition['name'] string Name of filter; use lowercase with no
- * punctuation
- * $filterDefinition['cssClassSuffix'] string CSS class suffix, used to mark
- * that a particular row belongs to this filter (when a row is included by the
- * filter) (optional)
- * $filterDefinition['isRowApplicableCallable'] Callable taking two parameters, the
- * IContextSource, and the RecentChange object for the row, and returning true if
- * the row is attributed to this filter. The above CSS class will then be
- * automatically added (optional, required if cssClassSuffix is used).
- * $filterDefinition['group'] ChangesListFilterGroup Group. Filter group this
- * belongs to.
- * $filterDefinition['label'] string i18n key of label for structured UI.
- * $filterDefinition['description'] string i18n key of description for structured
- * UI.
- * $filterDefinition['priority'] int Priority integer. Higher value means higher
- * up in the group's filter list.
+ * * $filterDefinition['name'] string Name of filter; use lowercase with no
+ * punctuation
+ * * $filterDefinition['cssClassSuffix'] string CSS class suffix, used to mark
+ * that a particular row belongs to this filter (when a row is included by the
+ * filter) (optional)
+ * * $filterDefinition['isRowApplicableCallable'] Callable taking two parameters, the
+ * IContextSource, and the RecentChange object for the row, and returning true if
+ * the row is attributed to this filter. The above CSS class will then be
+ * automatically added (optional, required if cssClassSuffix is used).
+ * * $filterDefinition['group'] ChangesListFilterGroup Group. Filter group this
+ * belongs to.
+ * * $filterDefinition['label'] string i18n key of label for structured UI.
+ * * $filterDefinition['description'] string i18n key of description for structured
+ * UI.
+ * * $filterDefinition['priority'] int Priority integer. Higher value means higher
+ * up in the group's filter list.
*/
public function __construct( array $filterDefinition ) {
if ( isset( $filterDefinition['group'] ) ) {
* This means that anything in the results for the other filter is also in the
* results for this one.
*
- * @param ChangesListFilter The filter the current instance is a superset of
+ * @param ChangesListFilter $other The filter the current instance is a superset of
*/
public function setAsSupersetOf( ChangesListFilter $other ) {
if ( $other->getGroup() !== $this->getGroup() ) {
*
* @param IContextSource $ctx Context source
* @param RecentChange $rc Recent changes object
- * @param Non-associative array of CSS class names; appended to if needed
+ * @param array &$classes Non-associative array of CSS class names; appended to if needed
*/
public function applyCssClassIfNeeded( IContextSource $ctx, RecentChange $rc, array &$classes ) {
if ( $this->isRowApplicableCallable === null ) {
protected $isFullCoverage;
/**
- * List of conflicting groups
+ * Array of associative arrays with conflict information. See
+ * setUnidirectionalConflict
*
- * @var array $conflictingGroups Array of associative arrays with conflict
- * information. See setUnidirectionalConflict
+ * @var array $conflictingGroups
*/
protected $conflictingGroups = [];
/**
- * List of conflicting filters
+ * Array of associative arrays with conflict information. See
+ * setUnidirectionalConflict
*
- * @var array $conflictingFilters Array of associative arrays with conflict
- * information. See setUnidirectionalConflict
+ * @var array $conflictingFilters
*/
protected $conflictingFilters = [];
* @param array $groupDefinition Configuration of group
* * $groupDefinition['name'] string Group name; use camelCase with no punctuation
* * $groupDefinition['title'] string i18n key for title (optional, can be omitted
- * * only if none of the filters in the group display in the structured UI)
+ * only if none of the filters in the group display in the structured UI)
* * $groupDefinition['type'] string A type constant from a subclass of this one
* * $groupDefinition['priority'] int Priority integer. Higher value means higher
- * * up in the group list (optional, defaults to -100).
+ * up in the group list (optional, defaults to -100).
* * $groupDefinition['filters'] array Numeric array of filter definitions, each of which
- * * is an associative array to be passed to the filter constructor. However,
- * * 'priority' is optional for the filters. Any filter that has priority unset
- * * will be put to the bottom, in the order given.
+ * is an associative array to be passed to the filter constructor. However,
+ * 'priority' is optional for the filters. Any filter that has priority unset
+ * will be put to the bottom, in the order given.
* * $groupDefinition['isFullCoverage'] bool Whether the group is full coverage;
- * * if true, this means that checking every item in the group means no
- * * changes list entries are filtered out.
+ * if true, this means that checking every item in the group means no
+ * changes list entries are filtered out.
* * $groupDefinition['whatsThisHeader'] string i18n key for header of "What's
- * * This" popup (optional).
+ * This" popup (optional).
* * $groupDefinition['whatsThisBody'] string i18n key for body of "What's This"
- * * popup (optional).
+ * popup (optional).
* * $groupDefinition['whatsThisUrl'] string URL for main link of "What's This"
- * * popup (optional).
+ * popup (optional).
* * $groupDefinition['whatsThisLinkText'] string i18n key of text for main link of
- * * "What's This" popup (optional).
+ * "What's This" popup (optional).
*/
public function __construct( array $groupDefinition ) {
if ( strpos( $groupDefinition['name'], self::RESERVED_NAME_CHAR ) !== false ) {
}
/**
- * @return array Associative array of ChangesListFilter objects, with filter name as key
+ * @return ChangesListFilter[] Associative array of ChangesListFilter objects, with
+ * filter name as key
*/
public function getFilters() {
return $this->filters;
*/
const NONE = '';
- /**
- * Group name; used as form parameter.
- *
- * @var string $name
- */
-
/**
* Defaul parameter value
*
* @param array $groupDefinition Configuration of group
* * $groupDefinition['name'] string Group name
* * $groupDefinition['title'] string i18n key for title (optional, can be omitted
- * * only if none of the filters in the group display in the structured UI)
+ * only if none of the filters in the group display in the structured UI)
* * $groupDefinition['priority'] int Priority integer. Higher means higher in the
- * * group list.
+ * group list.
* * $groupDefinition['filters'] array Numeric array of filter definitions, each of which
- * * is an associative array to be passed to the filter constructor. However,
- * * 'priority' is optional for the filters. Any filter that has priority unset
- * * will be put to the bottom, in the order given.
+ * is an associative array to be passed to the filter constructor. However,
+ * 'priority' is optional for the filters. Any filter that has priority unset
+ * will be put to the bottom, in the order given.
* * $groupDefinition['default'] string Default for group.
* * $groupDefinition['isFullCoverage'] bool Whether the group is full coverage;
- * * if true, this means that checking every item in the group means no
- * * changes list entries are filtered out.
+ * if true, this means that checking every item in the group means no
+ * changes list entries are filtered out.
* * $groupDefinition['queryCallable'] callable Callable accepting parameters:
- * * string $specialPageClassName Class name of current special page
- * * IContextSource $context Context, for e.g. user
- * * IDatabase $dbr Database, for addQuotes, makeList, and similar
- * * array &$tables Array of tables; see IDatabase::select $table
- * * array &$fields Array of fields; see IDatabase::select $vars
- * * array &$conds Array of conditions; see IDatabase::select $conds
- * * array &$query_options Array of query options; see IDatabase::select $options
- * * array &$join_conds Array of join conditions; see IDatabase::select $join_conds
- * * array $selectedValues The allowed and requested values, lower-cased and sorted
+ * * string $specialPageClassName Class name of current special page
+ * * IContextSource $context Context, for e.g. user
+ * * IDatabase $dbr Database, for addQuotes, makeList, and similar
+ * * array &$tables Array of tables; see IDatabase::select $table
+ * * array &$fields Array of fields; see IDatabase::select $vars
+ * * array &$conds Array of conditions; see IDatabase::select $conds
+ * * array &$query_options Array of query options; see IDatabase::select $options
+ * * array &$join_conds Array of join conditions; see IDatabase::select $join_conds
+ * * array $selectedValues The allowed and requested values, lower-cased and sorted
* * $groupDefinition['whatsThisHeader'] string i18n key for header of "What's
- * * This" popup (optional).
+ * This" popup (optional).
* * $groupDefinition['whatsThisBody'] string i18n key for body of "What's This"
- * * popup (optional).
+ * popup (optional).
* * $groupDefinition['whatsThisUrl'] string URL for main link of "What's This"
- * * popup (optional).
+ * popup (optional).
* * $groupDefinition['whatsThisLinkText'] string i18n key of text for main link of
- * * "What's This" popup (optional).
+ * "What's This" popup (optional).
*/
public function __construct( array $groupDefinition ) {
if ( !isset( $groupDefinition['isFullCoverage'] ) ) {
/**
* Get filter group definition from legacy custom filters
*
- * @param array Custom filters from legacy hooks
+ * @param array $customFilters Custom filters from legacy hooks
* @return array Group definition
*/
- protected function getFilterGroupDefinitionFromLegacyCustomFilters( $customFilters ) {
+ protected function getFilterGroupDefinitionFromLegacyCustomFilters( array $customFilters ) {
// Special internal unstructured group
$unstructuredGroupDefinition = [
'name' => 'unstructured',
* @param array &$query_options Array of query options; see IDatabase::select $options
* @param array &$join_conds Array of join conditions; see IDatabase::select $join_conds
* @param array $selectedExpLevels The allowed active values, sorted
+ * @param int $now Number of seconds since the UNIX epoch, or 0 if not given
+ * (optional)
*/
public function filterOnUserExperienceLevel( $specialPageClassName, $context, $dbr,
&$tables, &$fields, &$conds, &$query_options, &$join_conds, $selectedExpLevels, $now = 0 ) {