Skip to content

Commit 49bd0e8

Browse files
committed
Remove deprecated BigRational::simplified()
1 parent 4e4eb42 commit 49bd0e8

File tree

3 files changed

+4
-47
lines changed

3 files changed

+4
-47
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
## UNRELEASED (0.16.0)
66

7+
💥 **Breaking changes**
8+
9+
- Deprecated method `BigRational::simplified()` has been removed, as it is now a no-op
10+
711
**New features**
812

913
- New method: `BigDecimal::getIntegralPart()` returns the integral part as `BigInteger` (this method existed with a different signature in version 0.14, and was removed in 0.15)

src/BigRational.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
use function min;
1717
use function strlen;
1818
use function substr;
19-
use function trigger_error;
20-
21-
use const E_USER_DEPRECATED;
2219

2320
/**
2421
* An arbitrarily large rational number.
@@ -359,21 +356,6 @@ public function negated(): static
359356
return new BigRational($this->numerator->negated(), $this->denominator, false, false);
360357
}
361358

362-
/**
363-
* Returns the simplified value of this BigRational.
364-
*
365-
* @deprecated Since 0.15, this is a no-op. BigRational numbers are always in their simplest form.
366-
*/
367-
public function simplified(): BigRational
368-
{
369-
trigger_error(
370-
'BigRational::simplified() is a no-op since 0.15, and will be removed in 0.16. BigRational numbers are now always simplified to lowest terms.',
371-
E_USER_DEPRECATED,
372-
);
373-
374-
return $this;
375-
}
376-
377359
#[Override]
378360
public function compareTo(BigNumber|int|string $that): int
379361
{

tests/BigRationalTest.php

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -601,35 +601,6 @@ public static function providerNegated(): array
601601
];
602602
}
603603

604-
/**
605-
* @param string $rational The rational number to test.
606-
* @param string $expected The expected negated number.
607-
*/
608-
#[DataProvider('providerSimplified')]
609-
public function testSimplified(string $rational, string $expected): void
610-
{
611-
self::assertBigRationalEquals($expected, BigRational::of($rational)->simplified());
612-
}
613-
614-
public static function providerSimplified(): array
615-
{
616-
return [
617-
['0', '0'],
618-
['1', '1'],
619-
['-1', '-1'],
620-
['0/123456', '0'],
621-
['-0/123456', '0'],
622-
['-1/123456', '-1/123456'],
623-
['4/6', '2/3'],
624-
['-4/6', '-2/3'],
625-
['123/456', '41/152'],
626-
['-234/567', '-26/63'],
627-
['489798742123504998877665/387590928349859112233445', '32653249474900333258511/25839395223323940815563'],
628-
['-395651984391591565172038784/445108482440540510818543632', '-8/9'],
629-
['1.125', '9/8'],
630-
];
631-
}
632-
633604
/**
634605
* @param string $a The first number to compare.
635606
* @param int|string $b The second number to compare.

0 commit comments

Comments
 (0)