From c76746af08bb650da84e229d27eb5de3262767ad Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Mon, 30 Oct 2023 23:45:51 +0100 Subject: [PATCH] More specific Psalm return types for quotientAndRemainder() --- src/BigDecimal.php | 2 ++ src/BigInteger.php | 2 ++ src/BigRational.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/BigDecimal.php b/src/BigDecimal.php index 021ba7f..31d22ab 100644 --- a/src/BigDecimal.php +++ b/src/BigDecimal.php @@ -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 diff --git a/src/BigInteger.php b/src/BigInteger.php index fd23420..73dcc89 100644 --- a/src/BigInteger.php +++ b/src/BigInteger.php @@ -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 diff --git a/src/BigRational.php b/src/BigRational.php index 9e07215..fc3060e 100644 --- a/src/BigRational.php +++ b/src/BigRational.php @@ -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 {