diff --git a/composer.json b/composer.json index db44292..b34d9b1 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ ], "require": { "php": "^8.0", - "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13", + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14", "ramsey/collection": "^1.2 || ^2.0" }, "require-dev": { diff --git a/src/Math/BrickMathCalculator.php b/src/Math/BrickMathCalculator.php index 869835e..649f580 100644 --- a/src/Math/BrickMathCalculator.php +++ b/src/Math/BrickMathCalculator.php @@ -49,10 +49,10 @@ final class BrickMathCalculator implements CalculatorInterface $sum = BigInteger::of($augend->toString()); foreach ($addends as $addend) { - $sum = $sum->plus($addend->toString()); /** @phpstan-ignore possiblyImpure.methodCall */ + $sum = $sum->plus($addend->toString()); } - /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.new */ + /** @phpstan-ignore possiblyImpure.new */ return new IntegerObject((string) $sum); } @@ -61,10 +61,10 @@ final class BrickMathCalculator implements CalculatorInterface $difference = BigInteger::of($minuend->toString()); foreach ($subtrahends as $subtrahend) { - $difference = $difference->minus($subtrahend->toString()); /** @phpstan-ignore possiblyImpure.methodCall */ + $difference = $difference->minus($subtrahend->toString()); } - /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.new */ + /** @phpstan-ignore possiblyImpure.new */ return new IntegerObject((string) $difference); } @@ -73,11 +73,10 @@ final class BrickMathCalculator implements CalculatorInterface $product = BigInteger::of($multiplicand->toString()); foreach ($multipliers as $multiplier) { - /** @phpstan-ignore possiblyImpure.methodCall */ $product = $product->multipliedBy($multiplier->toString()); } - /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.new */ + /** @phpstan-ignore possiblyImpure.new */ return new IntegerObject((string) $product); } @@ -93,23 +92,22 @@ final class BrickMathCalculator implements CalculatorInterface $quotient = BigDecimal::of($dividend->toString()); foreach ($divisors as $divisor) { - /** @phpstan-ignore possiblyImpure.methodCall */ $quotient = $quotient->dividedBy($divisor->toString(), $scale, $brickRounding); } if ($scale === 0) { - /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.methodCall, possiblyImpure.new */ + /** @phpstan-ignore possiblyImpure.new */ return new IntegerObject((string) $quotient->toBigInteger()); } - /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.new */ + /** @phpstan-ignore possiblyImpure.new */ return new Decimal((string) $quotient); } public function fromBase(string $value, int $base): IntegerObject { try { - /** @phpstan-ignore possiblyImpure.methodCall, possiblyImpure.new */ + /** @phpstan-ignore possiblyImpure.new */ return new IntegerObject((string) BigInteger::fromBase($value, $base)); } catch (MathException | \InvalidArgumentException $exception) { throw new InvalidArgumentException( @@ -123,7 +121,6 @@ final class BrickMathCalculator implements CalculatorInterface public function toBase(IntegerObject $value, int $base): string { try { - /** @phpstan-ignore possiblyImpure.methodCall */ return BigInteger::of($value->toString())->toBase($base); } catch (MathException | \InvalidArgumentException $exception) { throw new InvalidArgumentException(