SinchSupportedCountries   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 123
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 123
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A isCountrySupported() 0 4 1
1
<?php
2
/*
3
 * This file is part of the FreshSinchBundle
4
 *
5
 * (c) Artem Henvald <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace Fresh\SinchBundle\Helper;
14
15
/**
16
 * SinchSupportedCountries.
17
 *
18
 * @author Artem Henvald <[email protected]>
19
 */
20
class SinchSupportedCountries
21
{
22
    /**
23
     * @const array
24
     */
25
    public const SUPPORTED_COUNTRIES = [
26
        'AF' => 'Afghanistan',
27
        'AM' => 'Armenia',
28
        'AR' => 'Argentina',
29
        'AT' => 'Austria',
30
        'AU' => 'Australia',
31
        'AZ' => 'Azerbaijan',
32
        'BA' => 'Bosnia & Herzegovina',
33
        'BD' => 'Bangladesh',
34
        'BE' => 'Belgium',
35
        'BG' => 'Bulgaria',
36
        'BH' => 'Bahrain',
37
        'BO' => 'Bolivia',
38
        'BR' => 'Brazil',
39
        'BS' => 'Bahamas',
40
        'BY' => 'Belarus',
41
        'CA' => 'Canada',
42
        'CD' => 'Congo - Kinshasa',
43
        'CF' => 'Central African Republic',
44
        'CG' => 'Congo - Brazzaville',
45
        'CH' => 'Switzerland',
46
        'CL' => 'Chile',
47
        'CN' => 'China',
48
        'CO' => 'Colombia',
49
        'CR' => 'Costa Rica',
50
        'CU' => 'Cuba',
51
        'CY' => 'Cyprus',
52
        'CZ' => 'Czech Republic',
53
        'DE' => 'Germany',
54
        'DK' => 'Denmark',
55
        'DZ' => 'Algeria',
56
        'EC' => 'Ecuador',
57
        'EG' => 'Egypt',
58
        'ES' => 'Spain',
59
        'FI' => 'Finland',
60
        'FR' => 'France',
61
        'GA' => 'Gabon',
62
        'GB' => 'United Kingdom',
63
        'GE' => 'Georgia',
64
        'GH' => 'Ghana',
65
        'GM' => 'Gambia',
66
        'GR' => 'Greece',
67
        'HK' => 'Hong Kong SAR China',
68
        'HR' => 'Croatia',
69
        'HU' => 'Hungary',
70
        'ID' => 'Indonesia',
71
        'IE' => 'Ireland',
72
        'IL' => 'Israel',
73
        'IN' => 'India',
74
        'IR' => 'Iran',
75
        'IT' => 'Italy',
76
        'JM' => 'Jamaica',
77
        'JP' => 'Japan',
78
        'KE' => 'Kenya',
79
        'KG' => 'Kyrgyzstan',
80
        'KH' => 'Cambodia',
81
        'KR' => 'South Korea',
82
        'KW' => 'Kuwait',
83
        'KZ' => 'Kazakhstan',
84
        'LB' => 'Lebanon',
85
        'LR' => 'Liberia',
86
        'LT' => 'Lithuania',
87
        'LU' => 'Luxembourg',
88
        'LV' => 'Latvia',
89
        'LY' => 'Libya',
90
        'MA' => 'Morocco',
91
        'MC' => 'Monaco',
92
        'MD' => 'Moldova',
93
        'MK' => 'Macedonia',
94
        'MN' => 'Mongolia',
95
        'MX' => 'Mexico',
96
        'MY' => 'Malaysia',
97
        'NG' => 'Nigeria',
98
        'NL' => 'Netherlands',
99
        'NO' => 'Norway',
100
        'NZ' => 'New Zealand',
101
        'PA' => 'Panama',
102
        'PE' => 'Peru',
103
        'PH' => 'Philippines',
104
        'PK' => 'Pakistan',
105
        'PL' => 'Poland',
106
        'PR' => 'Puerto Rico',
107
        'PT' => 'Portugal',
108
        'PY' => 'Paraguay',
109
        'QA' => 'Qatar',
110
        'RO' => 'Romania',
111
        'RU' => 'Russia',
112
        'SA' => 'Saudi Arabia',
113
        'SD' => 'Sudan',
114
        'SE' => 'Sweden',
115
        'SG' => 'Singapore',
116
        'SI' => 'Slovenia',
117
        'SK' => 'Slovakia',
118
        'SN' => 'Senegal',
119
        'SY' => 'Syria',
120
        'TH' => 'Thailand',
121
        'TN' => 'Tunisia',
122
        'TR' => 'Turkey',
123
        'TW' => 'Taiwan',
124
        'UA' => 'Ukraine',
125
        'UG' => 'Uganda',
126
        'US' => 'United States',
127
        'UY' => 'Uruguay',
128
        'VE' => 'Venezuela',
129
        'VN' => 'Vietnam',
130
        'ZA' => 'South Africa',
131
    ];
132
133
    /**
134
     * @param string $countryCode
135
     *
136
     * @return bool
137
     */
138
    public static function isCountrySupported(string $countryCode): bool
139
    {
140
        return isset(self::SUPPORTED_COUNTRIES[$countryCode]);
141
    }
142
}
143