It seems like $value can also be of type string; however, parameter $x of fmod() does only seem to accept double, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
21
if (fmod(/** @scrutinizer ignore-type */ $value, 1) !== 0.00) {
Loading history...
22
1
return $value;
23
}
24
25
1
if (\in_array($value % 100, [11, 12, 13], true)) {
26
1
return $value . 'th';
27
}
28
1
switch ($value % 10) {
29
1
case 1:
30
1
return $value . 'st';
31
1
case 2:
32
1
return $value . 'nd';
33
1
case 3:
34
1
return $value . 'rd';
35
default:
36
1
return $value . 'th';
37
}
38
}
39
40
/**
41
* Returns string representation of a number value without thousands separators and with dot as decimal separator.