Countries::getSourceData()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 254

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 254
ccs 0
cts 2
cp 0
rs 8
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2

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
namespace Magium\Configuration\Source\Political;
4
5
use Magium\Configuration\Source\SourceInterface;
6
7
class Countries implements SourceInterface
8
{
9
10
    public function getSourceData()
11
    {
12
        return [
13
            'AF' => 'Afghanistan',
14
            'AL' => 'Albania',
15
            'DZ' => 'Algeria',
16
            'AS' => 'American Samoa',
17
            'AD' => 'Andorra',
18
            'AO' => 'Angola',
19
            'AI' => 'Anguilla',
20
            'AQ' => 'Antarctica',
21
            'AG' => 'Antigua and Barbuda',
22
            'AR' => 'Argentina',
23
            'AM' => 'Armenia',
24
            'AW' => 'Aruba',
25
            'AU' => 'Australia',
26
            'AT' => 'Austria',
27
            'AZ' => 'Azerbaijan',
28
            'BS' => 'Bahamas',
29
            'BH' => 'Bahrain',
30
            'BD' => 'Bangladesh',
31
            'BB' => 'Barbados',
32
            'BY' => 'Belarus',
33
            'BE' => 'Belgium',
34
            'BZ' => 'Belize',
35
            'BJ' => 'Benin',
36
            'BM' => 'Bermuda',
37
            'BT' => 'Bhutan',
38
            'BO' => 'Bolivia',
39
            'BQ' => 'Bonaire',
40
            'BA' => 'Bosnia and Herzegovina',
41
            'BW' => 'Botswana',
42
            'BV' => 'Bouvet Island',
43
            'BR' => 'Brazil',
44
            'IO' => 'British Indian Ocean Territory',
45
            'BN' => 'Brunei Darussalam',
46
            'BG' => 'Bulgaria',
47
            'BF' => 'Burkina Faso',
48
            'BI' => 'Burundi',
49
            'KH' => 'Cambodia',
50
            'CM' => 'Cameroon',
51
            'CA' => 'Canada',
52
            'CV' => 'Cape Verde',
53
            'KY' => 'Cayman Islands',
54
            'CF' => 'Central African Republic',
55
            'TD' => 'Chad',
56
            'CL' => 'Chile',
57
            'CN' => 'China',
58
            'CX' => 'Christmas Island',
59
            'CC' => 'Cocos (Keeling) Islands',
60
            'CO' => 'Colombia',
61
            'KM' => 'Comoros',
62
            'CG' => 'Congo',
63
            'CD' => 'Democratic Republic of the Congo',
64
            'CK' => 'Cook Islands',
65
            'CR' => 'Costa Rica',
66
            'HR' => 'Croatia',
67
            'CU' => 'Cuba',
68
            'CW' => 'Curaçao',
69
            'CY' => 'Cyprus',
70
            'CZ' => 'Czech Republic',
71
            'CI' => 'Côte d\'Ivoire',
72
            'DK' => 'Denmark',
73
            'DJ' => 'Djibouti',
74
            'DM' => 'Dominica',
75
            'DO' => 'Dominican Republic',
76
            'EC' => 'Ecuador',
77
            'EG' => 'Egypt',
78
            'SV' => 'El Salvador',
79
            'GQ' => 'Equatorial Guinea',
80
            'ER' => 'Eritrea',
81
            'EE' => 'Estonia',
82
            'ET' => 'Ethiopia',
83
            'FK' => 'Falkland Islands (Malvinas)',
84
            'FO' => 'Faroe Islands',
85
            'FJ' => 'Fiji',
86
            'FI' => 'Finland',
87
            'FR' => 'France',
88
            'GF' => 'French Guiana',
89
            'PF' => 'French Polynesia',
90
            'TF' => 'French Southern Territories',
91
            'GA' => 'Gabon',
92
            'GM' => 'Gambia',
93
            'GE' => 'Georgia',
94
            'DE' => 'Germany',
95
            'GH' => 'Ghana',
96
            'GI' => 'Gibraltar',
97
            'GR' => 'Greece',
98
            'GL' => 'Greenland',
99
            'GD' => 'Grenada',
100
            'GP' => 'Guadeloupe',
101
            'GU' => 'Guam',
102
            'GT' => 'Guatemala',
103
            'GG' => 'Guernsey',
104
            'GN' => 'Guinea',
105
            'GW' => 'Guinea-Bissau',
106
            'GY' => 'Guyana',
107
            'HT' => 'Haiti',
108
            'HM' => 'Heard Island and McDonald Mcdonald Islands',
109
            'VA' => 'Holy See (Vatican City State)',
110
            'HN' => 'Honduras',
111
            'HK' => 'Hong Kong',
112
            'HU' => 'Hungary',
113
            'IS' => 'Iceland',
114
            'IN' => 'India',
115
            'ID' => 'Indonesia',
116
            'IR' => 'Iran, Islamic Republic of',
117
            'IQ' => 'Iraq',
118
            'IE' => 'Ireland',
119
            'IM' => 'Isle of Man',
120
            'IL' => 'Israel',
121
            'IT' => 'Italy',
122
            'JM' => 'Jamaica',
123
            'JP' => 'Japan',
124
            'JE' => 'Jersey',
125
            'JO' => 'Jordan',
126
            'KZ' => 'Kazakhstan',
127
            'KE' => 'Kenya',
128
            'KI' => 'Kiribati',
129
            'KP' => 'Korea, Democratic People\'s Republic of',
130
            'KR' => 'Korea, Republic of',
131
            'KW' => 'Kuwait',
132
            'KG' => 'Kyrgyzstan',
133
            'LA' => 'Lao People\'s Democratic Republic',
134
            'LV' => 'Latvia',
135
            'LB' => 'Lebanon',
136
            'LS' => 'Lesotho',
137
            'LR' => 'Liberia',
138
            'LY' => 'Libya',
139
            'LI' => 'Liechtenstein',
140
            'LT' => 'Lithuania',
141
            'LU' => 'Luxembourg',
142
            'MO' => 'Macao',
143
            'MK' => 'Macedonia, the Former Yugoslav Republic of',
144
            'MG' => 'Madagascar',
145
            'MW' => 'Malawi',
146
            'MY' => 'Malaysia',
147
            'MV' => 'Maldives',
148
            'ML' => 'Mali',
149
            'MT' => 'Malta',
150
            'MH' => 'Marshall Islands',
151
            'MQ' => 'Martinique',
152
            'MR' => 'Mauritania',
153
            'MU' => 'Mauritius',
154
            'YT' => 'Mayotte',
155
            'MX' => 'Mexico',
156
            'FM' => 'Micronesia, Federated States of',
157
            'MD' => 'Moldova, Republic of',
158
            'MC' => 'Monaco',
159
            'MN' => 'Mongolia',
160
            'ME' => 'Montenegro',
161
            'MS' => 'Montserrat',
162
            'MA' => 'Morocco',
163
            'MZ' => 'Mozambique',
164
            'MM' => 'Myanmar',
165
            'NA' => 'Namibia',
166
            'NR' => 'Nauru',
167
            'NP' => 'Nepal',
168
            'NL' => 'Netherlands',
169
            'NC' => 'New Caledonia',
170
            'NZ' => 'New Zealand',
171
            'NI' => 'Nicaragua',
172
            'NE' => 'Niger',
173
            'NG' => 'Nigeria',
174
            'NU' => 'Niue',
175
            'NF' => 'Norfolk Island',
176
            'MP' => 'Northern Mariana Islands',
177
            'NO' => 'Norway',
178
            'OM' => 'Oman',
179
            'PK' => 'Pakistan',
180
            'PW' => 'Palau',
181
            'PS' => 'Palestine, State of',
182
            'PA' => 'Panama',
183
            'PG' => 'Papua New Guinea',
184
            'PY' => 'Paraguay',
185
            'PE' => 'Peru',
186
            'PH' => 'Philippines',
187
            'PN' => 'Pitcairn',
188
            'PL' => 'Poland',
189
            'PT' => 'Portugal',
190
            'PR' => 'Puerto Rico',
191
            'QA' => 'Qatar',
192
            'RO' => 'Romania',
193
            'RU' => 'Russian Federation',
194
            'RW' => 'Rwanda',
195
            'RE' => 'Reunion',
196
            'BL' => 'Saint Barthelemy',
197
            'SH' => 'Saint Helena',
198
            'KN' => 'Saint Kitts and Nevis',
199
            'LC' => 'Saint Lucia',
200
            'MF' => 'Saint Martin (French part)',
201
            'PM' => 'Saint Pierre and Miquelon',
202
            'VC' => 'Saint Vincent and the Grenadines',
203
            'WS' => 'Samoa',
204
            'SM' => 'San Marino',
205
            'ST' => 'Sao Tome and Principe',
206
            'SA' => 'Saudi Arabia',
207
            'SN' => 'Senegal',
208
            'RS' => 'Serbia',
209
            'SC' => 'Seychelles',
210
            'SL' => 'Sierra Leone',
211
            'SG' => 'Singapore',
212
            'SX' => 'Sint Maarten (Dutch part)',
213
            'SK' => 'Slovakia',
214
            'SI' => 'Slovenia',
215
            'SB' => 'Solomon Islands',
216
            'SO' => 'Somalia',
217
            'ZA' => 'South Africa',
218
            'GS' => 'South Georgia and the South Sandwich Islands',
219
            'SS' => 'South Sudan',
220
            'ES' => 'Spain',
221
            'LK' => 'Sri Lanka',
222
            'SD' => 'Sudan',
223
            'SR' => 'Suriname',
224
            'SJ' => 'Svalbard and Jan Mayen',
225
            'SZ' => 'Swaziland',
226
            'SE' => 'Sweden',
227
            'CH' => 'Switzerland',
228
            'SY' => 'Syrian Arab Republic',
229
            'TW' => 'Taiwan, Province of China',
230
            'TJ' => 'Tajikistan',
231
            'TZ' => 'United Republic of Tanzania',
232
            'TH' => 'Thailand',
233
            'TL' => 'Timor-Leste',
234
            'TG' => 'Togo',
235
            'TK' => 'Tokelau',
236
            'TO' => 'Tonga',
237
            'TT' => 'Trinidad and Tobago',
238
            'TN' => 'Tunisia',
239
            'TR' => 'Turkey',
240
            'TM' => 'Turkmenistan',
241
            'TC' => 'Turks and Caicos Islands',
242
            'TV' => 'Tuvalu',
243
            'UG' => 'Uganda',
244
            'UA' => 'Ukraine',
245
            'AE' => 'United Arab Emirates',
246
            'GB' => 'United Kingdom',
247
            'US' => 'United States',
248
            'UM' => 'United States Minor Outlying Islands',
249
            'UY' => 'Uruguay',
250
            'UZ' => 'Uzbekistan',
251
            'VU' => 'Vanuatu',
252
            'VE' => 'Venezuela',
253
            'VN' => 'Viet Nam',
254
            'VG' => 'British Virgin Islands',
255
            'VI' => 'US Virgin Islands',
256
            'WF' => 'Wallis and Futuna',
257
            'EH' => 'Western Sahara',
258
            'YE' => 'Yemen',
259
            'ZM' => 'Zambia',
260
            'ZW' => 'Zimbabwe',
261
            'AX' => 'Aland Islands'
262
        ];
263
    }
264
265
266
}
267