From 6233c326eee7b660e1ae8aaed2a29d551926bcd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20K=C3=A4hm?= Date: Mon, 13 May 2024 09:06:41 +0200 Subject: [PATCH] [BUGFIX] PHPStan 1.11+ Fixes issue after PHPStan 1.11 upgrade: ``` Parameter #1 $boost of class ApacheSolrForTypo3\Solr\Domain\Search\Score\Score constructor expects float, string given. ``` --- Classes/Domain/Search/Score/ScoreCalculationService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/Domain/Search/Score/ScoreCalculationService.php b/Classes/Domain/Search/Score/ScoreCalculationService.php index ec445cf82a..f9436b79d4 100644 --- a/Classes/Domain/Search/Score/ScoreCalculationService.php +++ b/Classes/Domain/Search/Score/ScoreCalculationService.php @@ -86,7 +86,7 @@ public function parseScores(string $debugData, string $queryFields): array // split field from search term [$field, $searchTerm] = explode(':', $scoreMatches[2][$key]); - $currentScoreValue = $scoreMatches[1][$key]; + $currentScoreValue = (float)$scoreMatches[1][$key]; $scoreWasSetForFieldBefore = isset($highScores[$field]); $scoreIsHigher = false; @@ -101,7 +101,7 @@ public function parseScores(string $debugData, string $queryFields): array $pattern = '/' . preg_quote($field, '/') . '\^([\d.]*)/'; $boostMatches = []; preg_match_all($pattern, $queryFields, $boostMatches); - $boost = $boostMatches[1][0]; + $boost = (float)$boostMatches[1][0]; $highScores[$field] = new Score($boost, $field, $currentScoreValue, $searchTerm); } }