1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace VinaiKopp\CurrencyInfo\StaticAccess; |
4
|
|
|
|
5
|
|
|
use VinaiKopp\CurrencyInfo\StaticAccess\Internal\GenericCurrencyInfoAccess; |
6
|
|
|
|
7
|
|
|
class CurrencyInfo |
8
|
|
|
{ |
9
|
|
|
const SYMBOL = 'symbol'; |
10
|
|
|
const SYMBOL_NATIVE = 'symbol_native'; |
11
|
|
|
const FRACTION_DIGITS = 'decimal_digits'; |
12
|
|
|
const ROUNDING = 'rounding'; |
13
|
|
|
const CODE = 'code'; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* @return array[] |
17
|
|
|
*/ |
18
|
1 |
|
public static function getMap() |
19
|
|
|
{ |
20
|
1 |
|
return GenericCurrencyInfoAccess::getFullCurrencyInfo(); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @param string $currencyCode |
25
|
|
|
* @return array |
26
|
|
|
*/ |
27
|
2 |
|
public static function getMapForCurrency($currencyCode) |
28
|
|
|
{ |
29
|
2 |
|
return GenericCurrencyInfoAccess::getMapForCurrency($currencyCode); |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @return string[] |
34
|
|
|
*/ |
35
|
1 |
|
public static function getSymbolMap() |
36
|
|
|
{ |
37
|
1 |
|
return GenericCurrencyInfoAccess::getCurrencyInfoSubMap(self::SYMBOL); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @param string $currencyCode |
42
|
|
|
* @return string |
43
|
|
|
*/ |
44
|
1 |
|
public static function getSymbolForCurrency($currencyCode) |
45
|
|
|
{ |
46
|
1 |
|
return GenericCurrencyInfoAccess::getCurrencyInfoItemForCurrency(self::SYMBOL, $currencyCode); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @return string[] |
51
|
|
|
*/ |
52
|
1 |
|
public static function getNativeSymbolMap() |
53
|
|
|
{ |
54
|
1 |
|
return GenericCurrencyInfoAccess::getCurrencyInfoSubMap(self::SYMBOL_NATIVE); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @param string $currencyCode |
59
|
|
|
* @return string |
60
|
|
|
*/ |
61
|
1 |
|
public static function getNativeSymbolForCurrency($currencyCode) |
62
|
|
|
{ |
63
|
1 |
|
return GenericCurrencyInfoAccess::getCurrencyInfoItemForCurrency(self::SYMBOL_NATIVE, $currencyCode); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @return int[] |
68
|
|
|
*/ |
69
|
1 |
|
public static function getFractionDigitsMap() |
70
|
|
|
{ |
71
|
1 |
|
return GenericCurrencyInfoAccess::getCurrencyInfoSubMap(self::FRACTION_DIGITS); |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @param string $currencyCode |
76
|
|
|
* @return int |
77
|
|
|
*/ |
78
|
1 |
|
public static function getFractionDigitsForCurrency($currencyCode) |
79
|
|
|
{ |
80
|
1 |
|
return GenericCurrencyInfoAccess::getCurrencyInfoItemForCurrency(self::FRACTION_DIGITS, $currencyCode); |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @return float[] |
85
|
|
|
*/ |
86
|
1 |
|
public static function getRoundingMap() |
87
|
|
|
{ |
88
|
1 |
|
return GenericCurrencyInfoAccess::getCurrencyInfoSubMap(self::ROUNDING); |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* @param string $currencyCode |
93
|
|
|
* @return float |
94
|
|
|
*/ |
95
|
1 |
|
public static function getRoundingForCurrency($currencyCode) |
96
|
|
|
{ |
97
|
1 |
|
return GenericCurrencyInfoAccess::getCurrencyInfoItemForCurrency(self::ROUNDING, $currencyCode); |
98
|
|
|
} |
99
|
|
|
} |
100
|
|
|
|