We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca4e596 commit c965436Copy full SHA for c965436
2 files changed
src/IntType.php
@@ -17,7 +17,7 @@ final public static function from(
17
return (int) $value;
18
}
19
20
- if (Validators::isNumeric($value) && (int) $value === (int) \ceil(\abs((float) $value))) {
+ if (Validators::isNumeric($value) && \abs((int) $value) === (int) \ceil(\abs((float) $value))) {
21
22
23
tests/IntTypeTest.phpt
@@ -45,6 +45,9 @@ final class IntTypeTest extends TestCase
45
'1',
46
1.000_00,
47
'1.00000',
48
+ -1,
49
+ -1.0,
50
+ '-1.0',
51
];
52
53
foreach ($invalid as $value) {
0 commit comments