Skip to content

Commit

Permalink
Test: Fix Strict Comparison of Int to Float
Browse files Browse the repository at this point in the history
  • Loading branch information
kergomard committed Jan 10, 2024
1 parent b33d3ba commit cece0d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Modules/Test/classes/class.ilObjTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8134,15 +8134,15 @@ public static function _getBestPass($active_id)
);
if ($result->numRows()) {
$bestrow = null;
$bestfactor = 0;
$bestfactor = 0.0;
while ($row = $ilDB->fetchAssoc($result)) {
if ($row["maxpoints"] > 0) {
$factor = $row["points"] / $row["maxpoints"];
$factor = (float) ($row["points"] / $row["maxpoints"]);
} else {
$factor = 0;
$factor = 0.0;
}

if ($factor === 0 && $bestfactor === 0
if ($factor === 0.0 && $bestfactor === 0.0
|| $factor > $bestfactor) {
$bestrow = $row;
$bestfactor = $factor;
Expand Down

0 comments on commit cece0d9

Please sign in to comment.