Merge "Warn against certain jQuery methods"
[lhc/web/wiklou.git] / includes / search / SearchResultSet.php
index 5728a52..14d5c4b 100644 (file)
@@ -81,7 +81,7 @@ class SearchResultSet implements Countable, IteratorAggregate {
         *  results available.
         */
        public function __construct( $containedSyntax = false, $hasMoreResults = false ) {
-               if ( static::class === __CLASS__ ) {
+               if ( static::class === self::class ) {
                        // This class will eventually be abstract. SearchEngine implementations
                        // already have to extend this class anyways to provide the actual
                        // search results.
@@ -205,7 +205,7 @@ class SearchResultSet implements Countable, IteratorAggregate {
                $it = $this->bcIterator();
                $searchResult = $it->current();
                $it->next();
-               return $searchResult === null ? false : $searchResult;
+               return $searchResult ?? false;
        }
 
        /**
@@ -338,11 +338,7 @@ class SearchResultSet implements Countable, IteratorAggregate {
                        return;
                }
                $result->setExtensionData( function () use ( $id ) {
-                       if ( isset( $this->extraData[$id] ) ) {
-                               return $this->extraData[$id];
-                       } else {
-                               return [];
-                       }
+                       return $this->extraData[$id] ?? [];
                } );
        }