Currency::getCurrencies()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 58
Code Lines 56

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 56
c 1
b 0
f 0
dl 0
loc 58
rs 8.9599
cc 1
nc 1
nop 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
declare(strict_types=1);
4
5
namespace Promopult\TikTokMarketingApi\Appendix;
6
7
/**
8
 * @psalm-suppress UnusedClass
9
 */
10
final class Currency
11
{
12
    public static function getCurrencies(): array
13
    {
14
        return [
15
            ["US Dollar", "USD", 1, 0.01],
16
            ["Euro", "EUR", 1, 0.01],
17
            ["Japanese Yen", "JPY", 100, 1],
18
            ["Hong Kong Dollar", "HKD", 10, 0.01],
19
            ["British Pound", "GBP", 1, 0.01],
20
            ["Malaysian Ringgit", "MYR", 1, 0.01],
21
            ["Russian Ruble", "RUB", 100, 0.01],
22
            ["South African Rand", "ZAR", 10, 0.01],
23
            ["South Korean Won", "KRW", 1000, 1],
24
            ["UAE Dirham", "AED", 1, 0.01],
25
            ["Saudi Riyal", "SAR", 1, 0.01],
26
            ["Hungarian Forint", "HUF", 100, 1],
27
            ["Polish Zloty", "PLN", 1, 0.01],
28
            ["anish Krone", "DKK", 10, 0.01],
29
            ["Swedish Krona", "SEK", 10, 0.01],
30
            ["Norwegian Krone", "NOK", 10, 0.01],
31
            ["Turkish Lira", "TRY", 10, 0.01],
32
            ["Mexican Peso", "MXN", 10, 0.01],
33
            ["Thai Baht", "THB", 10, 0.01],
34
            ["Australian Dollar", "AUD", 1, 0.01],
35
            ["Canadian Dollar", "CAD", 1, 0.01],
36
            ["New Zealand Dollar", "NZD", 1, 0.01],
37
            ["Singapore Dollar", "SGD", 1, 0.01],
38
            ["Swiss Franc", "CHF", 1, 0.01],
39
            ["Chinese Yuan", "CNY", 10, 0.01],
40
            ["Algerian Dinar", "DZD", 100, 0.01],
41
            ["Argentine Peso", "ARS", 10, 0.01],
42
            ["Bangladeshi Taka", "BDT", 100, 0.01],
43
            ["Bolivian Boliviano", "BOB", 10, 0.01],
44
            ["Brazilian Real", "BRL", 1, 0.01],
45
            ["Chilean Peso", "CLP", 1000, 1],
46
            ["Colombian Peso", "COP", 1000, 1],
47
            ["Costa Rican Colon", "CRC", 1000, 1],
48
            ["Czech Koruna", "CZK", 10, 0.01],
49
            ["Egyptian Pound", "EGP", 10, 0.01],
50
            ["Guatemalan Quetzal", "GTQ", 10, 0.01],
51
            ["Honduran Lempira", "HNL", 10, 0.01],
52
            ["Icelandic Krona", "ISK", 100, 1],
53
            ["Indian Rupee", "INR", 100, 0.01],
54
            ["Indonesian Rupiah", "IDR", 10000, 1],
55
            ["Israeli New Shekel", "ILS", 1, 0.01],
56
            ["Kenyan Shilling", "KES", 100, 0.01],
57
            ["Macanese Pataca", "MOP", 10, 0.01],
58
            ["New Taiwan Dollar", "TWD", 10, 1],
59
            ["Nicaraguan Cordoba", "NIO", 10, 0.01],
60
            ["Nigerian Naira", "NGN", 100, 0.01],
61
            ["Pakistani Rupee", "PKR", 100, 0.01],
62
            ["Paraguayan Guarani", "PYG", 10000, 1],
63
            ["Peruvian Nuevo Sol", "PEN", 1, 0.01],
64
            ["Philippine Peso", "PHP", 100, 0.01],
65
            ["Qatari Riyal", "QAR", 1, 0.01],
66
            ["Romanian Leu", "RON", 1, 0.01],
67
            ["Uruguayan Peso", "UYU", 10, 0.01],
68
            ["Venezuelan Bolivar", "VEF", 100000, 1],
69
            ["Vietnamese Dong", "VND", 10000, 1],
70
        ];
71
    }
72
}
73