Skip to content

Commit

Permalink
Merge pull request #136 from bkosborne/patch-1
Browse files Browse the repository at this point in the history
Fixes #135: PHP 8.1 deprecation warning by casting float to an int
  • Loading branch information
seboettg authored Aug 5, 2022
2 parents 6dfdc2c + de293cd commit ceeef4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Rendering/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function render($data, $citationNumber = null): string
*/
public static function ordinal($num): string
{
if (($num / 10) % 10 == 1) {
if ((int) ($num / 10) % 10 == 1) {
$ordinalSuffix = CiteProc::getContext()->getLocale()->filter('terms', 'ordinal')->single;
} elseif ($num % 10 == 1) {
$ordinalSuffix = CiteProc::getContext()->getLocale()->filter('terms', 'ordinal-01')->single;
Expand Down

0 comments on commit ceeef4b

Please sign in to comment.