X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fchanges%2FChangesListFilterGroup.php;h=ec863073d5bd94b04e1d408f816d8410792f306b;hb=e73328601d51674e8fef89c3db12b30ceafd702f;hp=48c6e840a0a4936443402d445d21c01a12e01d42;hpb=433d2480f994932162da94b857e1d297d59cd4c8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/changes/ChangesListFilterGroup.php b/includes/changes/ChangesListFilterGroup.php index 48c6e840a0..ec863073d5 100644 --- a/includes/changes/ChangesListFilterGroup.php +++ b/includes/changes/ChangesListFilterGroup.php @@ -18,7 +18,6 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @license GPL 2+ * @author Matthew Flaschen */ @@ -175,11 +174,7 @@ abstract class ChangesListFilterGroup { } $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']; @@ -223,8 +218,7 @@ abstract class ChangesListFilterGroup { * (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) @@ -255,8 +249,7 @@ abstract class ChangesListFilterGroup { * * 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) @@ -325,7 +318,7 @@ abstract class ChangesListFilterGroup { * @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; } /** @@ -361,7 +354,7 @@ abstract class ChangesListFilterGroup { } usort( $this->filters, function ( $a, $b ) { - return $b->getPriority() - $a->getPriority(); + return $b->getPriority() <=> $a->getPriority(); } ); foreach ( $this->filters as $filterName => $filter ) { @@ -436,7 +429,7 @@ abstract class ChangesListFilterGroup { * @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 );