X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fsearch%2FSearchEngine.php;h=66e59e561bcbf896b54632e7717858dfe9b9b902;hp=32b0f0694d705234d9223c582f2cc2555dcd6784;hb=fa0f6f34972c0e0f4aac24a03b3efdfc45f256f6;hpb=4d26b1b8427afff47bc3b62bf38e103f39126ff6 diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index 32b0f0694d..66e59e561b 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -433,10 +433,13 @@ abstract class SearchEngine { /** * Find snippet highlight settings for all users * @return array Contextlines, contextchars + * @deprecated in 1.34 use the SearchHighlighter constants directly + * @see SearchHighlighter::DEFAULT_CONTEXT_CHARS + * @see SearchHighlighter::DEFAULT_CONTEXT_LINES */ public static function userHighlightPrefs() { - $contextlines = 2; // Hardcode this. Old defaults sucked. :) - $contextchars = 75; // same as above.... :P + $contextlines = SearchHighlighter::DEFAULT_CONTEXT_LINES; + $contextchars = SearchHighlighter::DEFAULT_CONTEXT_CHARS; return [ $contextlines, $contextchars ]; } @@ -486,6 +489,7 @@ abstract class SearchEngine { * @param Title $t Title we're indexing * @param Content|null $c Content of the page to index * @return string + * @deprecated since 1.34 use Content::getTextForSearchIndex directly */ public function getTextFromContent( Title $t, Content $c = null ) { return $c ? $c->getTextForSearchIndex() : ''; @@ -497,6 +501,7 @@ abstract class SearchEngine { * rather silly handling, it should return true here instead. * * @return bool + * @deprecated since 1.34 no longer needed since getTextFromContent is being deprecated */ public function textAlreadyUpdatedForIndex() { return false; @@ -722,6 +727,7 @@ abstract class SearchEngine { * @param string $profileType the type of profiles * @param User|null $user the user requesting the list of profiles * @return array|null the list of profiles or null if none available + * @phan-return null|array{name:string,desc-message:string,default?:bool} */ public function getProfiles( $profileType, User $user = null ) { return null; @@ -803,6 +809,10 @@ abstract class SearchEngine { $setAugmentors[$name] = new PerRowAugmentor( $row ); } + /** + * @var string $name + * @var ResultSetAugmentor $augmentor + */ foreach ( $setAugmentors as $name => $augmentor ) { $data = $augmentor->augmentAll( $resultSet ); if ( $data ) {