Skip to content

Commit

Permalink
Merge pull request #143 from hasanmonfared/master
Browse files Browse the repository at this point in the history
Fix warning Implicit conversion from float to int loses in PHP 8.1
  • Loading branch information
Morteza Parvini authored Apr 14, 2022
2 parents 825f462 + d5a7e99 commit c3245cf
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/CalendarUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,21 +202,20 @@ public static function jalaliCal($jy)
/**
* @param $a
* @param $b
* @return float
*/
public static function div($a, $b)
public static function div($a, $b):int
{
return ~~(intval($a / $b));
return intdiv($a ,$b);
}

/**
* @param $a
* @param $b
* @return mixed
*/
public static function mod($a, $b)
public static function mod($a, $b):int
{
return $a - ~~(intval($a / $b)) * $b;
return $a - intdiv($a , $b) * $b;
}

/**
Expand Down

0 comments on commit c3245cf

Please sign in to comment.