From 66832c41e9fff481c20ca219b3cc0a4e53b8b551 Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Wed, 25 Oct 2017 23:21:07 +0200 Subject: :arrow_up: Update intl library. Update intl library from v0.4? (2014) to v0.7.4 (2016). Use global composer autoloader now. --- .../src/NumberFormat/NumberFormatRepository.php | 87 ---------------------- 1 file changed, 87 deletions(-) delete mode 100644 library/intl/src/NumberFormat/NumberFormatRepository.php (limited to 'library/intl/src/NumberFormat/NumberFormatRepository.php') diff --git a/library/intl/src/NumberFormat/NumberFormatRepository.php b/library/intl/src/NumberFormat/NumberFormatRepository.php deleted file mode 100644 index 29a597906..000000000 --- a/library/intl/src/NumberFormat/NumberFormatRepository.php +++ /dev/null @@ -1,87 +0,0 @@ -definitionPath = $definitionPath ? $definitionPath : __DIR__ . '/../../resources/number_format/'; - } - - /** - * {@inheritdoc} - */ - public function get($locale, $fallbackLocale = null) - { - $locale = $this->resolveLocale($locale, $fallbackLocale); - if (!isset($this->definitions[$locale])) { - $filename = $this->definitionPath . $locale . '.json'; - $this->definitions[$locale] = json_decode(file_get_contents($filename), true); - } - - return $this->createNumberFormatFromDefinition($this->definitions[$locale], $locale); - } - - /** - * Creates a number format object from the provided definition. - * - * @param array $definition The number format definition. - * @param string $locale The locale of the number format definition. - * - * @return NumberFormat - */ - protected function createNumberFormatFromDefinition(array $definition, $locale) - { - if (!isset($definition['decimal_separator'])) { - $definition['decimal_separator'] = '.'; - } - if (!isset($definition['grouping_separator'])) { - $definition['grouping_separator'] = ','; - } - if (!isset($definition['plus_sign'])) { - $definition['plus_sign'] = '+'; - } - if (!isset($definition['minus_sign'])) { - $definition['minus_sign'] = '-'; - } - if (!isset($definition['percent_sign'])) { - $definition['percent_sign'] = '%'; - } - - $numberFormat = new NumberFormat(); - $numberFormat->setLocale($locale); - $numberFormat->setNumberingSystem($definition['numbering_system']); - $numberFormat->setDecimalSeparator($definition['decimal_separator']); - $numberFormat->setGroupingSeparator($definition['grouping_separator']); - $numberFormat->setPlusSign($definition['plus_sign']); - $numberFormat->setMinusSign($definition['minus_sign']); - $numberFormat->setPercentSign($definition['percent_sign']); - $numberFormat->setDecimalPattern($definition['decimal_pattern']); - $numberFormat->setPercentPattern($definition['percent_pattern']); - $numberFormat->setCurrencyPattern($definition['currency_pattern']); - $numberFormat->setAccountingCurrencyPattern($definition['accounting_currency_pattern']); - - return $numberFormat; - } -} -- cgit v1.2.3