diff options
author | jenkins-bot <jenkins-bot@gerrit.wikimedia.org> | 2018-05-16 13:31:56 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@wikimedia.org> | 2018-05-16 13:31:56 +0000 |
commit | cc0fe6c4a7cfad4dcecad5372c630d804914e4b2 (patch) | |
tree | 58dcf8c97b3e793dee0ae99cd6b0e3210424ca7a /includes/search/SearchEngine.php | |
parent | 81f07764b647d974d2b1c3b74aec99b3050b7edc (diff) | |
parent | fdc133ef1a249568f69df6b83d7e154c2103e10e (diff) | |
download | mediawikicore-cc0fe6c4a7cfad4dcecad5372c630d804914e4b2.tar.gz mediawikicore-cc0fe6c4a7cfad4dcecad5372c630d804914e4b2.zip |
Merge "Deprecate overriding SearchEngine::search*"
Diffstat (limited to 'includes/search/SearchEngine.php')
-rw-r--r-- | includes/search/SearchEngine.php | 49 |
1 files changed, 45 insertions, 4 deletions
diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index 0f65711bf64c..bd48e2136479 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -69,12 +69,25 @@ abstract class SearchEngine { /** * Perform a full text search query and return a result set. * If full text searches are not supported or disabled, return null. - * STUB + * + * As of 1.32 overriding this function is deprecated. It will + * be converted to final in 1.34. Override self::doSearchText(). + * + * @param string $term Raw search term + * @return SearchResultSet|Status|null + */ + public function searchText( $term ) { + return $this->doSearchText( $term ); + } + + /** + * Perform a full text search query and return a result set. * * @param string $term Raw search term * @return SearchResultSet|Status|null + * @since 1.32 */ - function searchText( $term ) { + protected function doSearchText( $term ) { return null; } @@ -85,11 +98,25 @@ abstract class SearchEngine { * The results returned by this methods are only sugegstions and * may not end up being shown to the user. * + * As of 1.32 overriding this function is deprecated. It will + * be converted to final in 1.34. Override self::doSearchArchiveTitle(). + * * @param string $term Raw search term * @return Status<Title[]> * @since 1.29 */ - function searchArchiveTitle( $term ) { + public function searchArchiveTitle( $term ) { + return $this->doSearchArchiveTitle( $term ); + } + + /** + * Perform a title search in the article archive. + * + * @param string $term Raw search term + * @return Status<Title[]> + * @since 1.32 + */ + protected function doSearchArchiveTitle( $term ) { return Status::newGood( [] ); } @@ -98,10 +125,24 @@ abstract class SearchEngine { * If title searches are not supported or disabled, return null. * STUB * + * As of 1.32 overriding this function is deprecated. It will + * be converted to final in 1.34. Override self::doSearchTitle(). + * + * @param string $term Raw search term + * @return SearchResultSet|null + */ + public function searchTitle( $term ) { + return $this->doSearchTitle( $term ); + } + + /** + * Perform a title-only search query and return a result set. + * * @param string $term Raw search term * @return SearchResultSet|null + * @since 1.32 */ - function searchTitle( $term ) { + protected function doSearchTitle( $term ) { return null; } |