Skip to content

Commit

Permalink
Fix #1015: convertTime expects to return int
Browse files Browse the repository at this point in the history
`Message::convertTime` expects to return `int`, but PHP `floor()` returns `float` or `boolean` (FALSE).
  • Loading branch information
pH-7 committed Jun 13, 2022
1 parent bc2d43d commit 0cb1351
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion _protected/framework/Layout/Form/Message.trait.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ private static function convertTime(int $iWaitTime): int
{
if ($iWaitTime > 60) {
$iDivide = ($iWaitTime < 1440) ? 60 : 1440;
$iWaitTime = floor($iWaitTime / $iDivide);

// Cast float value from `floor()` to integer
$iWaitTime = (int)floor($iWaitTime / $iDivide);
}

return $iWaitTime;
Expand Down

0 comments on commit 0cb1351

Please sign in to comment.