Addressed a range of deprecation warnings

Closes #3969
This commit is contained in:
Dan Brown
2023-01-21 20:50:04 +00:00
parent 28dda39260
commit 78ebcb6f38
17 changed files with 33 additions and 27 deletions

View File

@@ -112,12 +112,12 @@ class SearchIndex
*
* @returns array<string, int>
*/
protected function generateTermScoreMapFromText(string $text, int $scoreAdjustment = 1): array
protected function generateTermScoreMapFromText(string $text, float $scoreAdjustment = 1): array
{
$termMap = $this->textToTermCountMap($text);
foreach ($termMap as $term => $count) {
$termMap[$term] = $count * $scoreAdjustment;
$termMap[$term] = floor($count * $scoreAdjustment);
}
return $termMap;