diff --git a/phpstan.neon b/phpstan.neon index 2d7efab..be84088 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -23,3 +23,4 @@ parameters: paths: - src/Currency.php - identifier: missingType.iterableValue + - identifier: unset.possiblyHookedProperty diff --git a/src/PriceFormatter.php b/src/PriceFormatter.php index 67f0a19..cb2963c 100644 --- a/src/PriceFormatter.php +++ b/src/PriceFormatter.php @@ -44,7 +44,7 @@ class PriceFormatter $formatted = ltrim($formatted, $currency->prefix()); $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)) { throw new Exception('The formatted string could not be resolved to a valid number.');