Skip to content

Commit 558716b

Browse files
committed
Remove deprecated BigDecimal::hasNonZeroFractionalPart()
1 parent 4977414 commit 558716b

File tree

3 files changed

+6
-41
lines changed

3 files changed

+6
-41
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## UNRELEASED (0.17.0)
6+
7+
💥 **Breaking changes**
8+
9+
- Deprecated method `BigDecimal::hasNonZeroFractionalPart()` has been removed, use `! $number->getFractionalPart()->isZero()` instead
10+
511
## UNRELEASED (0.16.0)
612

713
💥 **Breaking changes**

src/BigDecimal.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
use function str_repeat;
2222
use function strlen;
2323
use function substr;
24-
use function trigger_error;
25-
26-
use const E_USER_DEPRECATED;
2724

2825
/**
2926
* An arbitrarily large decimal number.
@@ -699,21 +696,6 @@ public function getPrecision(): int
699696
return ($this->value[0] === '-') ? $length - 1 : $length;
700697
}
701698

702-
/**
703-
* Returns whether this decimal number has a non-zero fractional part.
704-
*
705-
* @deprecated Will be removed in 0.17. Use `! $number->getFractionalPart()->isZero()` instead.
706-
*/
707-
public function hasNonZeroFractionalPart(): bool
708-
{
709-
trigger_error(
710-
'BigDecimal::hasNonZeroFractionalPart() is deprecated and will be removed in 0.17. Use `! $number->getFractionalPart()->isZero()` instead.',
711-
E_USER_DEPRECATED,
712-
);
713-
714-
return ! $this->getFractionalPart()->isZero();
715-
}
716-
717699
/**
718700
* Returns the integral part of this decimal number.
719701
*

tests/BigDecimalTest.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3674,29 +3674,6 @@ public static function providerGetPrecision(): array
36743674
];
36753675
}
36763676

3677-
/**
3678-
* @param string $number The number to test.
3679-
* @param bool $hasNonZeroFractionalPart The expected return value.
3680-
*/
3681-
#[DataProvider('providerHasNonZeroFractionalPart')]
3682-
public function testHasNonZeroFractionalPart(string $number, bool $hasNonZeroFractionalPart): void
3683-
{
3684-
self::assertSame($hasNonZeroFractionalPart, BigDecimal::of($number)->hasNonZeroFractionalPart());
3685-
self::assertSame($hasNonZeroFractionalPart, ! BigDecimal::of($number)->getFractionalPart()->isZero());
3686-
}
3687-
3688-
public static function providerHasNonZeroFractionalPart(): array
3689-
{
3690-
return [
3691-
['1', false],
3692-
['1.0', false],
3693-
['1.01', true],
3694-
['-123456789', false],
3695-
['-123456789.0000000000000000000000000000000000000000000000000000000', false],
3696-
['-123456789.00000000000000000000000000000000000000000000000000000001', true],
3697-
];
3698-
}
3699-
37003677
/**
37013678
* @param string $number The decimal number to test.
37023679
* @param string $integralPart The expected integral part.

0 commit comments

Comments
 (0)