Merge "resourceloader: Implement mw.inspect 'time' report"
[lhc/web/wiklou.git] / includes / specials / pagers / ContribsPager.php
index e31498a..59fa948 100644 (file)
@@ -64,12 +64,12 @@ class ContribsPager extends RangeChronologicalPager {
                        $this->messages[$msg] = $this->msg( $msg )->escaped();
                }
 
-               $this->target = isset( $options['target'] ) ? $options['target'] : '';
-               $this->contribs = isset( $options['contribs'] ) ? $options['contribs'] : 'users';
-               $this->namespace = isset( $options['namespace'] ) ? $options['namespace'] : '';
-               $this->tagFilter = isset( $options['tagfilter'] ) ? $options['tagfilter'] : false;
-               $this->nsInvert = isset( $options['nsInvert'] ) ? $options['nsInvert'] : false;
-               $this->associated = isset( $options['associated'] ) ? $options['associated'] : false;
+               $this->target = $options['target'] ?? '';
+               $this->contribs = $options['contribs'] ?? 'users';
+               $this->namespace = $options['namespace'] ?? '';
+               $this->tagFilter = $options['tagfilter'] ?? false;
+               $this->nsInvert = $options['nsInvert'] ?? false;
+               $this->associated = $options['associated'] ?? false;
 
                $this->deletedOnly = !empty( $options['deletedOnly'] );
                $this->topOnly = !empty( $options['topOnly'] );
@@ -593,7 +593,10 @@ class ContribsPager extends RangeChronologicalPager {
 
                // Let extensions add data
                Hooks::run( 'ContributionsLineEnding', [ $this, &$ret, $row, &$classes, &$attribs ] );
-               $attribs = wfArrayFilterByKey( $attribs, [ Sanitizer::class, 'isReservedDataAttribute' ] );
+               $attribs = array_filter( $attribs,
+                       [ Sanitizer::class, 'isReservedDataAttribute' ],
+                       ARRAY_FILTER_USE_KEY
+               );
 
                // TODO: Handle exceptions in the catch block above.  Do any extensions rely on
                // receiving empty rows?
@@ -640,10 +643,10 @@ class ContribsPager extends RangeChronologicalPager {
         * @return array Options array with processed start and end date filter options
         */
        public static function processDateFilter( array $opts ) {
-               $start = isset( $opts['start'] ) ? $opts['start'] : '';
-               $end = isset( $opts['end'] ) ? $opts['end'] : '';
-               $year = isset( $opts['year'] ) ? $opts['year'] : '';
-               $month = isset( $opts['month'] ) ? $opts['month'] : '';
+               $start = $opts['start'] ?? '';
+               $end = $opts['end'] ?? '';
+               $year = $opts['year'] ?? '';
+               $month = $opts['month'] ?? '';
 
                if ( $start !== '' && $end !== '' && $start > $end ) {
                        $temp = $start;