From 49c51d38334e939204b090e28cf4ce69fe941721 Mon Sep 17 00:00:00 2001 From: nanaya Date: Thu, 2 May 2024 13:44:40 +0900 Subject: [PATCH] Fix another float/int mismatch Could also be updated to compare with int but the variable name kinda implies a float. --- app/Models/Traits/Scoreable.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Models/Traits/Scoreable.php b/app/Models/Traits/Scoreable.php index eb5a82c53f8..1afbb37f41e 100644 --- a/app/Models/Traits/Scoreable.php +++ b/app/Models/Traits/Scoreable.php @@ -87,8 +87,8 @@ public function recalculateRank(): void switch ($this->getMode()) { case 'osu': $totalHitCount = $totalHits / 300; - $ratio300 = $totalHits === 0 ? 1 : $this->count300 / $totalHitCount; - $ratio50 = $totalHits === 0 ? 1 : $this->count50 / $totalHitCount; + $ratio300 = (float) ($totalHits === 0 ? 1 : $this->count300 / $totalHitCount); + $ratio50 = (float) ($totalHits === 0 ? 1 : $this->count50 / $totalHitCount); $this->rank = match (true) { $ratio300 === 1.0 => @@ -109,8 +109,8 @@ public function recalculateRank(): void case 'taiko': $totalHitCount = $totalHits / 300; - $ratio300 = $totalHits === 0 ? 1 : $this->count300 / $totalHitCount; - $ratio50 = $totalHits === 0 ? 1 : $this->count50 / $totalHitCount; + $ratio300 = (float) ($totalHits === 0 ? 1 : $this->count300 / $totalHitCount); + $ratio50 = (float) ($totalHits === 0 ? 1 : $this->count50 / $totalHitCount); $this->rank = match (true) { $ratio300 === 1.0 =>