Merge "Type hint against LinkTarget in WatchedItemStore"
[lhc/web/wiklou.git] / includes / widget / search / DidYouMeanWidget.php
index 4e5b76b..a8f57e2 100644 (file)
@@ -3,7 +3,7 @@
 namespace MediaWiki\Widget\Search;
 
 use HtmlArmor;
-use SearchResultSet;
+use ISearchResultSet;
 use SpecialSearch;
 
 /**
@@ -20,10 +20,10 @@ class DidYouMeanWidget {
 
        /**
         * @param string $term The user provided search term
-        * @param SearchResultSet $resultSet
+        * @param ISearchResultSet $resultSet
         * @return string HTML
         */
-       public function render( $term, SearchResultSet $resultSet ) {
+       public function render( $term, ISearchResultSet $resultSet ) {
                if ( $resultSet->hasRewrittenQuery() ) {
                        $html = $this->rewrittenHtml( $term, $resultSet );
                } elseif ( $resultSet->hasSuggestion() ) {
@@ -40,16 +40,16 @@ class DidYouMeanWidget {
         * rewritten, and the results of the rewritten query are being returned.
         *
         * @param string $term The users search input
-        * @param SearchResultSet $resultSet The response to the search request
+        * @param ISearchResultSet $resultSet The response to the search request
         * @return string HTML Links the user to their original $term query, and the
         *  one suggested by $resultSet
         */
-       protected function rewrittenHtml( $term, SearchResultSet $resultSet ) {
+       protected function rewrittenHtml( $term, ISearchResultSet $resultSet ) {
                $params = [
                        'search' => $resultSet->getQueryAfterRewrite(),
                        // Don't magic this link into a 'go' link, it should always
                        // show search results.
-                       'fultext' => 1,
+                       'fulltext' => 1,
                ];
                $stParams = array_merge( $params, $this->specialSearch->powerSearchOptions() );
 
@@ -67,7 +67,7 @@ class DidYouMeanWidget {
                $original = $linkRenderer->makeKnownLink(
                        $this->specialSearch->getPageTitle(),
                        $term,
-                       [ 'id' => 'mwsearch-DYM-original' ],
+                       [ 'id' => 'mw-search-DYM-original' ],
                        $stParams
                );
 
@@ -81,10 +81,10 @@ class DidYouMeanWidget {
         * a query that might give more/better results than their current
         * query.
         *
-        * @param SearchResultSet $resultSet
+        * @param ISearchResultSet $resultSet
         * @return string HTML
         */
-       protected function suggestionHtml( SearchResultSet $resultSet ) {
+       protected function suggestionHtml( ISearchResultSet $resultSet ) {
                $params = [
                        'search' => $resultSet->getSuggestionQuery(),
                        'fulltext' => 1,