1<?php 2 3/* 4 * This file is part of the Symfony package. 5 * 6 * (c) Fabien Potencier <fabien@symfony.com> 7 * 8 * For the full copyright and license information, please view the LICENSE 9 * file that was distributed with this source code. 10 */ 11 12namespace Symfony\Polyfill\Intl\Icu; 13 14/** 15 * @author Nicolas Grekas <p@tchwork.com> 16 * 17 * @internal 18 */ 19class Currencies 20{ 21 private static $data; 22 23 public static function getSymbol(string $currency): ?string 24 { 25 $data = self::$data ?? self::$data = require __DIR__.'/Resources/currencies.php'; 26 27 return $data[$currency][0] ?? $data[strtoupper($currency)][0] ?? null; 28 } 29 30 public static function getFractionDigits(string $currency): int 31 { 32 $data = self::$data ?? self::$data = require __DIR__.'/Resources/currencies.php'; 33 34 return $data[$currency][1] ?? $data[strtoupper($currency)][1] ?? $data['DEFAULT'][1]; 35 } 36 37 public static function getRoundingIncrement(string $currency): int 38 { 39 $data = self::$data ?? self::$data = require __DIR__.'/Resources/currencies.php'; 40 41 return $data[$currency][2] ?? $data[strtoupper($currency)][2] ?? $data['DEFAULT'][2]; 42 } 43} 44