Skip to content

Commit

Permalink
[BUGFIX] PHPStan 1.11+
Browse files Browse the repository at this point in the history
Fixes issue after PHPStan 1.11 upgrade:

```
Parameter #1 $boost of class ApacheSolrForTypo3\Solr\Domain\Search\Score\Score constructor expects float, string given.
```
  • Loading branch information
dkd-kaehm authored and dkd-friedrich committed May 13, 2024
1 parent 0c6e3d0 commit 6233c32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/Domain/Search/Score/ScoreCalculationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 6233c32

Please sign in to comment.