Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Calculator/GmpCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@
$finalResult = substr($resultBase, 0, $decimalPlaces * -1) . '.' . $result;

if ($negativeZero) {
// @phpstan-ignore possiblyImpure.functionCall (see https://github.com/phpstan/phpstan/issues/11884)
$finalResult = str_replace('-.', '-0.', $finalResult);

Check failure on line 111 in src/Calculator/GmpCalculator.php

View workflow job for this annotation

GitHub Actions / Build lowest version

Possibly impure call to function str_replace() in pure method Money\Calculator\GmpCalculator::multiply().
}

return $finalResult;
Expand Down
6 changes: 2 additions & 4 deletions src/Parser/IntlMoneyParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ public function __construct(private readonly NumberFormatter $formatter, private
public function parse(string $money, Currency|null $fallbackCurrency = null): Money
{
$currency = '';
// phpcs:ignore
/** @var string|float|bool|null $decimal */
$decimal = $this->formatter->parseCurrency($money, $currency);
$decimal = $this->formatter->parseCurrency($money, $currency);

if ($decimal === false || $decimal === null) {
if ($decimal === false) {
throw new ParserException('Cannot parse ' . $money . ' to Money. ' . $this->formatter->getErrorMessage());
}

Expand Down
Loading