* http://www.gnu.org/copyleft/gpl.html
*
* @file
- * @license GPL 2+
* @author Matthew Flaschen
*/
}
$this->type = $groupDefinition['type'];
- if ( isset( $groupDefinition['priority'] ) ) {
- $this->priority = $groupDefinition['priority'];
- } else {
- $this->priority = self::DEFAULT_PRIORITY;
- }
+ $this->priority = $groupDefinition['priority'] ?? self::DEFAULT_PRIORITY;
$this->isFullCoverage = $groupDefinition['isFullCoverage'];
* (not filtered out), even for the hide-based filters. So e.g. conflicting with
* 'hideanons' means there is a conflict if only anonymous users are *shown*.
*
- * @param ChangesListFilterGroup|ChangesListFilter $other Other
- * ChangesListFilterGroup or ChangesListFilter
+ * @param ChangesListFilterGroup|ChangesListFilter $other
* @param string $globalKey i18n key for top-level conflict message
* @param string $forwardKey i18n key for conflict message in this
* direction (when in UI context of $this object)
*
* Internal use ONLY.
*
- * @param ChangesListFilterGroup|ChangesListFilter $other Other
- * ChangesListFilterGroup or ChangesListFilter
+ * @param ChangesListFilterGroup|ChangesListFilter $other
* @param string $globalDescription i18n key for top-level conflict message
* @param string $contextDescription i18n key for conflict message in this
* direction (when in UI context of $this object)
* @return ChangesListFilter|null Specified filter, or null if it is not registered
*/
public function getFilter( $name ) {
- return isset( $this->filters[$name] ) ? $this->filters[$name] : null;
+ return $this->filters[$name] ?? null;
}
/**
}
usort( $this->filters, function ( $a, $b ) {
- return $b->getPriority() - $a->getPriority();
+ return $b->getPriority() <=> $a->getPriority();
} );
foreach ( $this->filters as $filterName => $filter ) {
* @return bool
*/
public function anySelected( FormOptions $opts ) {
- return !!count( array_filter(
+ return (bool)count( array_filter(
$this->getFilters(),
function ( ChangesListFilter $filter ) use ( $opts ) {
return $filter->isSelected( $opts );