From 6c81485143000153b1d1c8ee31d686a917dcc9b1 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sat, 7 Sep 2024 21:56:00 +0200 Subject: [PATCH] search: Add missing documentation to class properties Add doc-typehints to class properties found by the PropertyDocumentation sniff to improve the documentation. Once the sniff is enabled it avoids that new code is missing type declarations. This is focused on documentation and does not change code. Change-Id: I2606072015d71b4bdda70a7c149d9f55ac205a3c --- includes/search/SearchEngine.php | 1 + includes/search/SearchHighlighter.php | 1 + includes/search/SearchMySQL.php | 2 ++ includes/search/SearchResultSet.php | 1 + tests/phpunit/mocks/search/MockSearchResult.php | 3 +++ 5 files changed, 8 insertions(+) diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index 07dab05053d..f03b730ba01 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -62,6 +62,7 @@ abstract class SearchEngine { /** @var bool */ protected $showSuggestion = true; + /** @var string */ private $sort = self::DEFAULT_SORT; /** @var array Feature values */ diff --git a/includes/search/SearchHighlighter.php b/includes/search/SearchHighlighter.php index 259d0e48dba..4406b721bec 100644 --- a/includes/search/SearchHighlighter.php +++ b/includes/search/SearchHighlighter.php @@ -38,6 +38,7 @@ class SearchHighlighter { public const DEFAULT_CONTEXT_LINES = 2; public const DEFAULT_CONTEXT_CHARS = 75; + /** @var bool */ protected $mCleanWikitext = true; /** diff --git a/includes/search/SearchMySQL.php b/includes/search/SearchMySQL.php index 65d5e44c556..ddbab89c4ac 100644 --- a/includes/search/SearchMySQL.php +++ b/includes/search/SearchMySQL.php @@ -36,8 +36,10 @@ use Wikimedia\Rdbms\SelectQueryBuilder; * @ingroup Search */ class SearchMySQL extends SearchDatabase { + /** @var bool */ protected $strictMatching = true; + /** @var int|null */ private static $mMinSearchLength; /** diff --git a/includes/search/SearchResultSet.php b/includes/search/SearchResultSet.php index b0a962a6f57..7f28e3aee3b 100644 --- a/includes/search/SearchResultSet.php +++ b/includes/search/SearchResultSet.php @@ -30,6 +30,7 @@ class SearchResultSet extends BaseSearchResultSet { use SearchResultSetTrait; + /** @var bool */ protected $containedSyntax = false; /** diff --git a/tests/phpunit/mocks/search/MockSearchResult.php b/tests/phpunit/mocks/search/MockSearchResult.php index ec60cf32cf6..0ff1ceca6bd 100644 --- a/tests/phpunit/mocks/search/MockSearchResult.php +++ b/tests/phpunit/mocks/search/MockSearchResult.php @@ -1,8 +1,11 @@