Add ISearchResultSet
[lhc/web/wiklou.git] / includes / specials / SpecialSearch.php
index 49f26ad..eacc7a0 100644 (file)
@@ -377,9 +377,9 @@ class SpecialSearch extends SpecialPage {
 
                $hasErrors = $textStatus && $textStatus->getErrors() !== [];
                $hasOtherResults = $textMatches &&
-                       $textMatches->hasInterwikiResults( SearchResultSet::INLINE_RESULTS );
+                       $textMatches->hasInterwikiResults( ISearchResultSet::INLINE_RESULTS );
 
-               if ( $textMatches && $textMatches->hasInterwikiResults( SearchResultSet::SECONDARY_RESULTS ) ) {
+               if ( $textMatches && $textMatches->hasInterwikiResults( ISearchResultSet::SECONDARY_RESULTS ) ) {
                        $out->addHTML( '<div class="searchresults mw-searchresults-has-iw">' );
                } else {
                        $out->addHTML( '<div class="searchresults">' );
@@ -443,14 +443,6 @@ class SpecialSearch extends SpecialPage {
                        $term, $this->offset, $titleMatches, $textMatches
                ) );
 
-               if ( $titleMatches ) {
-                       $titleMatches->free();
-               }
-
-               if ( $textMatches ) {
-                       $textMatches->free();
-               }
-
                $out->addHTML( '<div class="mw-search-visualclear"></div>' );
 
                // prev/next links
@@ -463,13 +455,13 @@ class SpecialSearch extends SpecialPage {
                                $offset = $this->offset;
                        }
 
-                       $prevnext = $this->buildPrevNextNavigation(
+                       $prevNext = $this->buildPrevNextNavigation(
                                $offset,
                                $this->limit,
                                $this->powerSearchOptions() + [ 'search' => $term ],
                                $this->limit + $this->offset >= $totalRes
                        );
-                       $out->addHTML( "<p class='mw-search-pager-bottom'>{$prevnext}</p>\n" );
+                       $out->addHTML( "<p class='mw-search-pager-bottom'>{$prevNext}</p>\n" );
                }
 
                // Close <div class='searchresults'>
@@ -481,8 +473,8 @@ class SpecialSearch extends SpecialPage {
        /**
         * @param Title $title
         * @param int $num The number of search results found
-        * @param null|SearchResultSet $titleMatches Results from title search
-        * @param null|SearchResultSet $textMatches Results from text search
+        * @param null|ISearchResultSet $titleMatches Results from title search
+        * @param null|ISearchResultSet $textMatches Results from text search
         */
        protected function showCreateLink( $title, $num, $titleMatches, $textMatches ) {
                // show direct page/create link if applicable