Common/Util/FormatterFactory.php
public function create(string $locale = null, string $currency = null)
    {
        $locale = $locale ?? $this->localeProvider->getCurrentLocale();
        $currency = $currency ?? $this->currencyProvider->getCurrentCurrency();

        if (isset($this->cache[$key = strtolower("$locale-$currency")])) {
            return $this->cache[$key];
        }

        return $this->cache[$key] = new Formatter($locale, $currency);
    }
public function create(string $locale = null, string $currency = null)
    {
        $locale = $locale ?? $this->localeProvider->getCurrentLocale();
        $currency = $currency ?? $this->currencyProvider->getCurrentCurrency();

        if (isset($this->cache[$key = strtolower("$locale-$currency")])) {
            return $this->cache[$key];
        }

        return $this->cache[$key] = new Formatter($locale, $currency);
    }
Creates a new formatter.

@param string|null $locale
@param string|null $currency

@return Formatter