Conditions | 7 |
Paths | 4 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public static function currencies($longlist = false): array |
||
21 | { |
||
22 | $list = $longlist ? 'longlist' : 'shortlist'; |
||
23 | |||
24 | if (! isset(static::$currencies[$list])) { |
||
25 | $countries = CountryLoader::countries($longlist); |
||
26 | |||
27 | foreach ($countries as $country) { |
||
28 | if ($longlist) { |
||
29 | foreach ($country['currency'] as $currency => $details) { |
||
30 | static::$currencies[$list][$currency] = $longlist ? $details : $currency; |
||
31 | } |
||
32 | } else { |
||
33 | static::$currencies[$list][] = $country['currency']; |
||
34 | } |
||
35 | } |
||
36 | } |
||
37 | |||
38 | return static::$currencies[$list]; |
||
39 | } |
||
40 | } |
||
41 |