From: David Causse Date: Tue, 23 Jul 2019 08:59:41 +0000 (+0200) Subject: Add explicit visibility to ISearchResultSet methods X-Git-Tag: 1.34.0-rc.0~844^2 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=79895c7882e6e9cd5c8be62780308d2b0d35fbb8;p=lhc%2Fweb%2Fwiklou.git Add explicit visibility to ISearchResultSet methods Change-Id: Ic1ad60fac6183004c4dfc110c8dfde95b57cdd9b --- diff --git a/includes/search/ISearchResultSet.php b/includes/search/ISearchResultSet.php index 1b30f5ae14..0dd902b139 100644 --- a/includes/search/ISearchResultSet.php +++ b/includes/search/ISearchResultSet.php @@ -19,7 +19,7 @@ interface ISearchResultSet extends \Countable, \IteratorAggregate { /** * @return int */ - function numRows(); + public function numRows(); /** * Some search modes return a total hit count for the query @@ -31,7 +31,7 @@ interface ISearchResultSet extends \Countable, \IteratorAggregate { * * @return int|null */ - function getTotalHits(); + public function getTotalHits(); /** * Some search modes will run an alternative query that it thinks gives @@ -40,19 +40,19 @@ interface ISearchResultSet extends \Countable, \IteratorAggregate { * * @return bool */ - function hasRewrittenQuery(); + public function hasRewrittenQuery(); /** * @return string|null The search the query was internally rewritten to, * or null when the result of the original query was returned. */ - function getQueryAfterRewrite(); + public function getQueryAfterRewrite(); /** * @return string|null Same as self::getQueryAfterRewrite(), but in HTML * and with changes highlighted. Null when the query was not rewritten. */ - function getQueryAfterRewriteSnippet(); + public function getQueryAfterRewriteSnippet(); /** * Some search modes return a suggested alternate term if there are @@ -60,17 +60,17 @@ interface ISearchResultSet extends \Countable, \IteratorAggregate { * * @return bool */ - function hasSuggestion(); + public function hasSuggestion(); /** * @return string|null Suggested query, null if none */ - function getSuggestionQuery(); + public function getSuggestionQuery(); /** * @return string HTML highlighted suggested query, '' if none */ - function getSuggestionSnippet(); + public function getSuggestionSnippet(); /** * Return a result set of hits on other (multiple) wikis associated with this one @@ -78,7 +78,7 @@ interface ISearchResultSet extends \Countable, \IteratorAggregate { * @param int $type * @return ISearchResultSet[] */ - function getInterwikiResults( $type = self::SECONDARY_RESULTS ); + public function getInterwikiResults( $type = self::SECONDARY_RESULTS ); /** * Check if there are results on other wikis @@ -86,7 +86,7 @@ interface ISearchResultSet extends \Countable, \IteratorAggregate { * @param int $type * @return bool */ - function hasInterwikiResults( $type = self::SECONDARY_RESULTS ); + public function hasInterwikiResults( $type = self::SECONDARY_RESULTS ); /** * Did the search contain search syntax? If so, Special:Search won't offer diff --git a/includes/search/SearchResultSet.php b/includes/search/SearchResultSet.php index 84f8bcfd54..c9686bcdff 100644 --- a/includes/search/SearchResultSet.php +++ b/includes/search/SearchResultSet.php @@ -86,11 +86,11 @@ class SearchResultSet implements ISearchResultSet { * @return string[] * @deprecated since 1.34 (use SqlSearchResult) */ - function termMatches() { + public function termMatches() { return []; } - function numRows() { + public function numRows() { return $this->count(); } @@ -108,7 +108,7 @@ class SearchResultSet implements ISearchResultSet { * * @return int */ - function getTotalHits() { + public function getTotalHits() { return null; } @@ -119,7 +119,7 @@ class SearchResultSet implements ISearchResultSet { * * @return bool */ - function hasRewrittenQuery() { + public function hasRewrittenQuery() { return false; } @@ -127,7 +127,7 @@ class SearchResultSet implements ISearchResultSet { * @return string|null The search the query was internally rewritten to, * or null when the result of the original query was returned. */ - function getQueryAfterRewrite() { + public function getQueryAfterRewrite() { return null; } @@ -135,7 +135,7 @@ class SearchResultSet implements ISearchResultSet { * @return string|null Same as self::getQueryAfterRewrite(), but in HTML * and with changes highlighted. Null when the query was not rewritten. */ - function getQueryAfterRewriteSnippet() { + public function getQueryAfterRewriteSnippet() { return null; } @@ -145,21 +145,21 @@ class SearchResultSet implements ISearchResultSet { * * @return bool */ - function hasSuggestion() { + public function hasSuggestion() { return false; } /** * @return string|null Suggested query, null if none */ - function getSuggestionQuery() { + public function getSuggestionQuery() { return null; } /** * @return string HTML highlighted suggested query, '' if none */ - function getSuggestionSnippet() { + public function getSuggestionSnippet() { return ''; } @@ -169,7 +169,7 @@ class SearchResultSet implements ISearchResultSet { * @param int $type * @return ISearchResultSet[] */ - function getInterwikiResults( $type = self::SECONDARY_RESULTS ) { + public function getInterwikiResults( $type = self::SECONDARY_RESULTS ) { return null; } @@ -179,7 +179,7 @@ class SearchResultSet implements ISearchResultSet { * @param int $type * @return bool */ - function hasInterwikiResults( $type = self::SECONDARY_RESULTS ) { + public function hasInterwikiResults( $type = self::SECONDARY_RESULTS ) { return false; } @@ -224,7 +224,7 @@ class SearchResultSet implements ISearchResultSet { * Frees the result set, if applicable. * @deprecated noop since 1.34 */ - function free() { + public function free() { } /**