Skip to content

Commit

Permalink
Clean up redundant doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Jan 15, 2023
1 parent 5f17c7a commit 5104f5b
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 404 deletions.
78 changes: 0 additions & 78 deletions src/BigDecimal.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ protected function __construct(string $value, int $scale = 0)
/**
* Creates a BigDecimal of the given value.
*
* @param BigNumber|int|float|string $value
*
* @return BigDecimal
*
* @throws MathException If the value cannot be converted to a BigDecimal.
*
* @psalm-pure
Expand All @@ -68,8 +64,6 @@ public static function of(BigNumber|int|float|string $value) : BigDecimal
* @param BigNumber|int|float|string $value The unscaled value. Must be convertible to a BigInteger.
* @param int $scale The scale of the number, positive or zero.
*
* @return BigDecimal
*
* @throws \InvalidArgumentException If the scale is negative.
*
* @psalm-pure
Expand All @@ -86,8 +80,6 @@ public static function ofUnscaledValue(BigNumber|int|float|string $value, int $s
/**
* Returns a BigDecimal representing zero, with a scale of zero.
*
* @return BigDecimal
*
* @psalm-pure
*/
public static function zero() : BigDecimal
Expand All @@ -108,8 +100,6 @@ public static function zero() : BigDecimal
/**
* Returns a BigDecimal representing one, with a scale of zero.
*
* @return BigDecimal
*
* @psalm-pure
*/
public static function one() : BigDecimal
Expand All @@ -130,8 +120,6 @@ public static function one() : BigDecimal
/**
* Returns a BigDecimal representing ten, with a scale of zero.
*
* @return BigDecimal
*
* @psalm-pure
*/
public static function ten() : BigDecimal
Expand All @@ -156,8 +144,6 @@ public static function ten() : BigDecimal
*
* @param BigNumber|int|float|string $that The number to add. Must be convertible to a BigDecimal.
*
* @return BigDecimal The result.
*
* @throws MathException If the number is not valid, or is not convertible to a BigDecimal.
*/
public function plus(BigNumber|int|float|string $that) : BigDecimal
Expand Down Expand Up @@ -187,8 +173,6 @@ public function plus(BigNumber|int|float|string $that) : BigDecimal
*
* @param BigNumber|int|float|string $that The number to subtract. Must be convertible to a BigDecimal.
*
* @return BigDecimal The result.
*
* @throws MathException If the number is not valid, or is not convertible to a BigDecimal.
*/
public function minus(BigNumber|int|float|string $that) : BigDecimal
Expand All @@ -214,8 +198,6 @@ public function minus(BigNumber|int|float|string $that) : BigDecimal
*
* @param BigNumber|int|float|string $that The multiplier. Must be convertible to a BigDecimal.
*
* @return BigDecimal The result.
*
* @throws MathException If the multiplier is not a valid number, or is not convertible to a BigDecimal.
*/
public function multipliedBy(BigNumber|int|float|string $that) : BigDecimal
Expand Down Expand Up @@ -243,8 +225,6 @@ public function multipliedBy(BigNumber|int|float|string $that) : BigDecimal
* @param int|null $scale The desired scale, or null to use the scale of this number.
* @param int $roundingMode An optional rounding mode.
*
* @return BigDecimal
*
* @throws \InvalidArgumentException If the scale or rounding mode is invalid.
* @throws MathException If the number is invalid, is zero, or rounding was necessary.
*/
Expand Down Expand Up @@ -281,8 +261,6 @@ public function dividedBy(BigNumber|int|float|string $that, ?int $scale = null,
*
* @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal.
*
* @return BigDecimal The result.
*
* @throws MathException If the divisor is not a valid number, is not convertible to a BigDecimal, is zero,
* or the result yields an infinite number of digits.
*/
Expand Down Expand Up @@ -322,10 +300,6 @@ public function exactlyDividedBy(BigNumber|int|float|string $that) : BigDecimal
*
* The result has a scale of `$this->scale * $exponent`.
*
* @param int $exponent The exponent.
*
* @return BigDecimal The result.
*
* @throws \InvalidArgumentException If the exponent is not in the range 0 to 1,000,000.
*/
public function power(int $exponent) : BigDecimal
Expand Down Expand Up @@ -356,8 +330,6 @@ public function power(int $exponent) : BigDecimal
*
* @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal.
*
* @return BigDecimal The quotient.
*
* @throws MathException If the divisor is not a valid decimal number, or is zero.
*/
public function quotient(BigNumber|int|float|string $that) : BigDecimal
Expand All @@ -383,8 +355,6 @@ public function quotient(BigNumber|int|float|string $that) : BigDecimal
*
* @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal.
*
* @return BigDecimal The remainder.
*
* @throws MathException If the divisor is not a valid decimal number, or is zero.
*/
public function remainder(BigNumber|int|float|string $that) : BigDecimal
Expand Down Expand Up @@ -440,10 +410,6 @@ public function quotientAndRemainder(BigNumber|int|float|string $that) : array
/**
* Returns the square root of this number, rounded down to the given number of decimals.
*
* @param int $scale
*
* @return BigDecimal
*
* @throws \InvalidArgumentException If the scale is negative.
* @throws NegativeNumberException If this number is negative.
*/
Expand Down Expand Up @@ -484,10 +450,6 @@ public function sqrt(int $scale) : BigDecimal

/**
* Returns a copy of this BigDecimal with the decimal point moved $n places to the left.
*
* @param int $n
*
* @return BigDecimal
*/
public function withPointMovedLeft(int $n) : BigDecimal
{
Expand All @@ -504,10 +466,6 @@ public function withPointMovedLeft(int $n) : BigDecimal

/**
* Returns a copy of this BigDecimal with the decimal point moved $n places to the right.
*
* @param int $n
*
* @return BigDecimal
*/
public function withPointMovedRight(int $n) : BigDecimal
{
Expand All @@ -534,8 +492,6 @@ public function withPointMovedRight(int $n) : BigDecimal

/**
* Returns a copy of this BigDecimal with any trailing zeros removed from the fractional part.
*
* @return BigDecimal
*/
public function stripTrailingZeros() : BigDecimal
{
Expand Down Expand Up @@ -567,8 +523,6 @@ public function stripTrailingZeros() : BigDecimal

/**
* Returns the absolute value of this number.
*
* @return BigDecimal
*/
public function abs() : BigDecimal
{
Expand All @@ -577,8 +531,6 @@ public function abs() : BigDecimal

/**
* Returns the negated value of this number.
*
* @return BigDecimal
*/
public function negated() : BigDecimal
{
Expand Down Expand Up @@ -607,17 +559,11 @@ public function getSign() : int
return ($this->value === '0') ? 0 : (($this->value[0] === '-') ? -1 : 1);
}

/**
* @return BigInteger
*/
public function getUnscaledValue() : BigInteger
{
return self::newBigInteger($this->value);
}

/**
* @return int
*/
public function getScale() : int
{
return $this->scale;
Expand All @@ -627,8 +573,6 @@ public function getScale() : int
* Returns a string representing the integral part of this decimal number.
*
* Example: `-123.456` => `-123`.
*
* @return string
*/
public function getIntegralPart() : string
{
Expand All @@ -647,8 +591,6 @@ public function getIntegralPart() : string
* If the scale is zero, an empty string is returned.
*
* Examples: `-123.456` => '456', `123` => ''.
*
* @return string
*/
public function getFractionalPart() : string
{
Expand All @@ -663,8 +605,6 @@ public function getFractionalPart() : string

/**
* Returns whether this decimal number has a non-zero fractional part.
*
* @return bool
*/
public function hasNonZeroFractionalPart() : bool
{
Expand Down Expand Up @@ -741,8 +681,6 @@ public function __serialize(): array
*
* @param array{value: string, scale: int} $data
*
* @return void
*
* @throws \LogicException
*/
public function __unserialize(array $data): void
Expand All @@ -759,8 +697,6 @@ public function __unserialize(array $data): void
* This method is required by interface Serializable and SHOULD NOT be accessed directly.
*
* @internal
*
* @return string
*/
public function serialize() : string
{
Expand All @@ -773,10 +709,6 @@ public function serialize() : string
* @internal
* @psalm-suppress RedundantPropertyInitializationCheck
*
* @param string $value
*
* @return void
*
* @throws \LogicException
*/
public function unserialize($value) : void
Expand All @@ -794,9 +726,6 @@ public function unserialize($value) : void
/**
* Puts the internal values of the given decimal numbers on the same scale.
*
* @param BigDecimal $x The first decimal number.
* @param BigDecimal $y The second decimal number.
*
* @return array{string, string} The scaled integer values of $x and $y.
*/
private function scaleValues(BigDecimal $x, BigDecimal $y) : array
Expand All @@ -813,11 +742,6 @@ private function scaleValues(BigDecimal $x, BigDecimal $y) : array
return [$a, $b];
}

/**
* @param int $scale
*
* @return string
*/
private function valueWithMinScale(int $scale) : string
{
$value = $this->value;
Expand All @@ -831,8 +755,6 @@ private function valueWithMinScale(int $scale) : string

/**
* Adds leading zeros if necessary to the unscaled value to represent the full decimal number.
*
* @return string
*/
private function getUnscaledValueWithLeadingZeros() : string
{
Expand Down

0 comments on commit 5104f5b

Please sign in to comment.