mirror of
https://github.com/archtechx/money.git
synced 2025-12-12 11:24:03 +00:00
phpstan fixes
This commit is contained in:
parent
1ee60cb22d
commit
e30211058a
2 changed files with 2 additions and 1 deletions
|
|
@ -23,3 +23,4 @@ parameters:
|
||||||
paths:
|
paths:
|
||||||
- src/Currency.php
|
- src/Currency.php
|
||||||
- identifier: missingType.iterableValue
|
- identifier: missingType.iterableValue
|
||||||
|
- identifier: unset.possiblyHookedProperty
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ class PriceFormatter
|
||||||
$formatted = ltrim($formatted, $currency->prefix());
|
$formatted = ltrim($formatted, $currency->prefix());
|
||||||
$formatted = rtrim($formatted, $currency->suffix());
|
$formatted = rtrim($formatted, $currency->suffix());
|
||||||
|
|
||||||
$removeNonDigits = preg_replace('/[^\d' . preg_quote($currency->decimalSeparator()) . ']/', '', $formatted);
|
$removeNonDigits = preg_replace('/[^\d' . preg_quote($currency->decimalSeparator(), '/') . ']/', '', $formatted);
|
||||||
|
|
||||||
if (! is_string($removeNonDigits)) {
|
if (! is_string($removeNonDigits)) {
|
||||||
throw new Exception('The formatted string could not be resolved to a valid number.');
|
throw new Exception('The formatted string could not be resolved to a valid number.');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue