Skip to content

Commit 4c6e18c

Browse files
committed
Seal BigNumber
1 parent 509de3e commit 4c6e18c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/BigNumber.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
use Override;
1212

1313
/**
14-
* Common interface for arbitrary-precision rational numbers.
14+
* Base class for arbitrary-precision numbers.
15+
*
16+
* This class is sealed: it is part of the public API but should not be subclassed in userland.
17+
* Protected methods may change in any version.
18+
*
19+
* @phpstan-sealed BigInteger|BigDecimal|BigRational
1520
*/
1621
abstract readonly class BigNumber implements \JsonSerializable, \Stringable
1722
{
@@ -324,8 +329,6 @@ private static function add(BigNumber $a, BigNumber $b) : BigNumber
324329
return $b->plus($a);
325330
}
326331

327-
/** @var BigInteger $a */
328-
329332
return $a->plus($b);
330333
}
331334

0 commit comments

Comments
 (0)