Skip to content

Commit

Permalink
Fix documented exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Dec 2, 2023
1 parent f510c0a commit df446b4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down
8 changes: 6 additions & 2 deletions src/BigNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
Expand Down Expand Up @@ -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
*/
Expand Down

0 comments on commit df446b4

Please sign in to comment.