Skip to content

Commit

Permalink
More specific Psalm return types for quotientAndRemainder()
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Nov 19, 2023
1 parent 70843ed commit c76746a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/BigDecimal.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ public function remainder(BigNumber|int|float|string $that) : BigDecimal
*
* @return BigDecimal[] An array containing the quotient and the remainder.
*
* @psalm-return array{BigDecimal, BigDecimal}
*
* @throws MathException If the divisor is not a valid decimal number, or is zero.
*/
public function quotientAndRemainder(BigNumber|int|float|string $that) : array
Expand Down
2 changes: 2 additions & 0 deletions src/BigInteger.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@ public function remainder(BigNumber|int|float|string $that) : BigInteger
*
* @return BigInteger[] An array containing the quotient and the remainder.
*
* @psalm-return array{BigInteger, BigInteger}
*
* @throws DivisionByZeroException If the divisor is zero.
*/
public function quotientAndRemainder(BigNumber|int|float|string $that) : array
Expand Down
2 changes: 2 additions & 0 deletions src/BigRational.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ public function remainder() : BigInteger
* Returns the quotient and remainder of the division of the numerator by the denominator.
*
* @return BigInteger[]
*
* @psalm-return array{BigInteger, BigInteger}
*/
public function quotientAndRemainder() : array
{
Expand Down

0 comments on commit c76746a

Please sign in to comment.