diff --git a/CHANGELOG.md b/CHANGELOG.md index 680fa9b..74edb71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## UNRELEASED (0.12.2) + +👌 **Improvements** + +- Add missing `RoundingNecessaryException` to the `@throws` annotation of `BigNumber::of()` + ## [0.12.1](https://github.com/brick/math/releases/tag/0.12.1) - 2023-11-29 ⚡️ **Performance improvements** diff --git a/src/BigNumber.php b/src/BigNumber.php index 5a0df78..3902919 100644 --- a/src/BigNumber.php +++ b/src/BigNumber.php @@ -51,8 +51,9 @@ abstract class BigNumber implements \JsonSerializable * - strings containing a `.` character or using an exponential notation are returned as BigDecimal * - strings containing only digits with an optional leading `+` or `-` sign are returned as BigInteger * - * @throws NumberFormatException If the format of the number is not valid. + * @throws NumberFormatException If the format of the number is not valid. * @throws DivisionByZeroException If the value represents a rational number with a denominator of zero. + * @throws RoundingNecessaryException If the value cannot be converted to an instance of the subclass without rounding. * * @psalm-pure */ @@ -71,6 +72,9 @@ final public static function of(BigNumber|int|float|string $value) : static } /** + * @throws NumberFormatException If the format of the number is not valid. + * @throws DivisionByZeroException If the value represents a rational number with a denominator of zero. + * * @psalm-pure */ private static function _of(BigNumber|int|float|string $value) : BigNumber @@ -163,7 +167,7 @@ private static function _of(BigNumber|int|float|string $value) : BigNumber /** * Overridden by subclasses to convert a BigNumber to an instance of the subclass. * - * @throws MathException If the value cannot be converted. + * @throws RoundingNecessaryException If the value cannot be converted. * * @psalm-pure */