| Conditions | 1 |
| Paths | 1 |
| Total Lines | 196 |
| Code Lines | 194 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
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:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 12 | public static function getAreaCodes(): array |
||
| 13 | { |
||
| 14 | return [ |
||
| 15 | ['Andorra', 'AD'], |
||
| 16 | ['United Arab Emirates', 'AE'], |
||
| 17 | ['Afghanistan', 'AF'], |
||
| 18 | ['Antigua and Barbuda', 'AG'], |
||
| 19 | ['Albania', 'AL'], |
||
| 20 | ['Armenia', 'AM'], |
||
| 21 | ['Angola', 'AO'], |
||
| 22 | ['Argentina', 'AR'], |
||
| 23 | ['Austria', 'AT'], |
||
| 24 | ['Australia', 'AU'], |
||
| 25 | ['Azerbaijan', 'AZ'], |
||
| 26 | ['Bosnia & Herzegovina', 'BA'], |
||
| 27 | ['Barbados', 'BB'], |
||
| 28 | ['Bangladesh', 'BD'], |
||
| 29 | ['Belgium', 'BE'], |
||
| 30 | ['Burkina Faso', 'BF'], |
||
| 31 | ['Bulgaria', 'BG'], |
||
| 32 | ['Bahrain', 'BH'], |
||
| 33 | ['Burundi', 'BI'], |
||
| 34 | ['Benin', 'BJ'], |
||
| 35 | ['Brunei', 'BN'], |
||
| 36 | ['Bolivia', 'BO'], |
||
| 37 | ['Brazil', 'BR'], |
||
| 38 | ['Commonwealth of the Bahamas', 'BS'], |
||
| 39 | ['Bhutan', 'BT'], |
||
| 40 | ['Botswana', 'BW'], |
||
| 41 | ['Belarus', 'BY'], |
||
| 42 | ['Belize', 'BZ'], |
||
| 43 | ['Canada', 'CA'], |
||
| 44 | ['Switzerland', 'CH'], |
||
| 45 | ['Cote D\'Ivoire', 'CI'], |
||
| 46 | ['Chile', 'CL'], |
||
| 47 | ['Cameroon', 'CM'], |
||
| 48 | ['China', 'CN'], |
||
| 49 | ['Colombia', 'CO'], |
||
| 50 | ['Costa Rica', 'CR'], |
||
| 51 | ['Cape Verde', 'CV'], |
||
| 52 | ['Cyprus', 'CY'], |
||
| 53 | ['Czech Republic', 'CZ'], |
||
| 54 | ['Germany', 'DE'], |
||
| 55 | ['Djibouti', 'DJ'], |
||
| 56 | ['Denmark', 'DK'], |
||
| 57 | ['Dominica', 'DM'], |
||
| 58 | ['Dominican Republic', 'DO'], |
||
| 59 | ['Algeria', 'DZ'], |
||
| 60 | ['Ecuador', 'EC'], |
||
| 61 | ['Estonia', 'EE'], |
||
| 62 | ['Egypt', 'EG'], |
||
| 63 | ['Eritrea', 'ER'], |
||
| 64 | ['Spain', 'ES'], |
||
| 65 | ['Ethiopia', 'ET'], |
||
| 66 | ['Finland', 'FI'], |
||
| 67 | ['Fiji', 'FJ'], |
||
| 68 | ['Micronesia', 'FM'], |
||
| 69 | ['France', 'FR'], |
||
| 70 | ['Gabon', 'GA'], |
||
| 71 | ['United Kingdom', 'GB'], |
||
| 72 | ['Grenada', 'GD'], |
||
| 73 | ['Georgia', 'GE'], |
||
| 74 | ['Ghana', 'GH'], |
||
| 75 | ['Gibraltar', 'GI'], |
||
| 76 | ['Gambia', 'GM'], |
||
| 77 | ['Guinea', 'GN'], |
||
| 78 | ['Equatorial Guinea', 'GQ'], |
||
| 79 | ['Greece', 'GR'], |
||
| 80 | ['Guatemala', 'GT'], |
||
| 81 | ['Guinea-Bissau', 'GW'], |
||
| 82 | ['Guyana', 'GY'], |
||
| 83 | ['Hong Kong', 'HK'], |
||
| 84 | ['Honduras', 'HN'], |
||
| 85 | ['Croatia', 'HR'], |
||
| 86 | ['Haiti', 'HT'], |
||
| 87 | ['Hungary', 'HU'], |
||
| 88 | ['Indonesia', 'ID'], |
||
| 89 | ['Ireland', 'IE'], |
||
| 90 | ['Israel', 'IL'], |
||
| 91 | ['India', 'IN'], |
||
| 92 | ['Iraq', 'IQ'], |
||
| 93 | ['Iceland', 'IS'], |
||
| 94 | ['Italy', 'IT'], |
||
| 95 | ['Jamaica', 'JM'], |
||
| 96 | ['Jordan', 'JO'], |
||
| 97 | ['Japan', 'JP'], |
||
| 98 | ['Kenya', 'KE'], |
||
| 99 | ['Kyrgyzstan', 'KG'], |
||
| 100 | ['Cambodia', 'KH'], |
||
| 101 | ['Kiribati', 'KI'], |
||
| 102 | ['Comoros', 'KM'], |
||
| 103 | ['Saint Christopher and Nevis', 'KN'], |
||
| 104 | ['Korea, South', 'KR'], |
||
| 105 | ['Kuwait', 'KW'], |
||
| 106 | ['Cayman Islands', 'KY'], |
||
| 107 | ['Kazakhstan', 'KZ'], |
||
| 108 | ['Laos', 'LA'], |
||
| 109 | ['Lebanon', 'LB'], |
||
| 110 | ['Saint Lucia', 'LC'], |
||
| 111 | ['Liechtenstein', 'LI'], |
||
| 112 | ['Sri Lanka', 'LK'], |
||
| 113 | ['Liberia', 'LR'], |
||
| 114 | ['Lesotho', 'LS'], |
||
| 115 | ['Lithuania', 'LT'], |
||
| 116 | ['Luxembourg', 'LU'], |
||
| 117 | ['Latvia', 'LV'], |
||
| 118 | ['Libya', 'LY'], |
||
| 119 | ['Morocco', 'MA'], |
||
| 120 | ['Monaco', 'MC'], |
||
| 121 | ['Moldova', 'MD'], |
||
| 122 | ['Montenegro', 'ME'], |
||
| 123 | ['Madagascar', 'MG'], |
||
| 124 | ['Marshall Islands', 'MH'], |
||
| 125 | ['Macedonia', 'MK'], |
||
| 126 | ['Mali', 'ML'], |
||
| 127 | ['Myanmar', 'MM'], |
||
| 128 | ['Mongolia', 'MN'], |
||
| 129 | ['Macau', 'MO'], |
||
| 130 | ['Mauritania', 'MR'], |
||
| 131 | ['Malta', 'MT'], |
||
| 132 | ['Mauritius', 'MU'], |
||
| 133 | ['Maldives', 'MV'], |
||
| 134 | ['Malawi', 'MW'], |
||
| 135 | ['Mexico', 'MX'], |
||
| 136 | ['Malaysia', 'MY'], |
||
| 137 | ['Mozambique', 'MZ'], |
||
| 138 | ['Namibia', 'NA'], |
||
| 139 | ['Niger', 'NE'], |
||
| 140 | ['Nigeria', 'NG'], |
||
| 141 | ['Nicaragua', 'NI'], |
||
| 142 | ['Netherlands', 'NL'], |
||
| 143 | ['Norway', 'NO'], |
||
| 144 | ['Nepal', 'NP'], |
||
| 145 | ['Nauru', 'NR'], |
||
| 146 | ['New Zealand', 'NZ'], |
||
| 147 | ['Oman', 'OM'], |
||
| 148 | ['Panama', 'PA'], |
||
| 149 | ['Peru', 'PE'], |
||
| 150 | ['Papua New Guinea', 'PG'], |
||
| 151 | ['Philippines', 'PH'], |
||
| 152 | ['Pakistan', 'PK'], |
||
| 153 | ['Poland', 'PL'], |
||
| 154 | ['Puerto Rico', 'PR'], |
||
| 155 | ['Palestine', 'PS'], |
||
| 156 | ['Portugal', 'PT'], |
||
| 157 | ['Palau', 'PW'], |
||
| 158 | ['Paraguay', 'PY'], |
||
| 159 | ['Qatar', 'QA'], |
||
| 160 | ['Romania', 'RO'], |
||
| 161 | ['Serbia', 'RS'], |
||
| 162 | ['Russia', 'RU'], |
||
| 163 | ['Rwanda', 'RW'], |
||
| 164 | ['Saudi Arabia', 'SA'], |
||
| 165 | ['Solomon Islands', 'SB'], |
||
| 166 | ['Seychelles', 'SC'], |
||
| 167 | ['Sweden', 'SE'], |
||
| 168 | ['Singapore', 'SG'], |
||
| 169 | ['Slovenia', 'SI'], |
||
| 170 | ['Slovakia', 'SK'], |
||
| 171 | ['Sierra Leone', 'SL'], |
||
| 172 | ['San Marino', 'SM'], |
||
| 173 | ['Senegal', 'SN'], |
||
| 174 | ['Somali', 'SO'], |
||
| 175 | ['Suriname', 'SR'], |
||
| 176 | ['Sao Tomé and Príncipe', 'ST'], |
||
| 177 | ['El Salvador', 'SV'], |
||
| 178 | ['Swaziland', 'SZ'], |
||
| 179 | ['Chad', 'TD'], |
||
| 180 | ['Togo', 'TG'], |
||
| 181 | ['Thailand', 'TH'], |
||
| 182 | ['Tajikistan', 'TJ'], |
||
| 183 | ['Timor-Leste', 'TL'], |
||
| 184 | ['Turkmenistan', 'TM'], |
||
| 185 | ['Tunisia', 'TN'], |
||
| 186 | ['Tonga', 'TO'], |
||
| 187 | ['Turkey', 'TR'], |
||
| 188 | ['Trinidad and Tobago', 'TT'], |
||
| 189 | ['Tuvalu', 'TV'], |
||
| 190 | ['Taiwan', 'TW'], |
||
| 191 | ['Tanzania', 'TZ'], |
||
| 192 | ['Ukraine', 'UA'], |
||
| 193 | ['Uganda', 'UG'], |
||
| 194 | ['United States', 'US'], |
||
| 195 | ['Uruguay', 'UY'], |
||
| 196 | ['Uzbekistan', 'UZ'], |
||
| 197 | ['Vatican City', 'VA'], |
||
| 198 | ['Saint Vincent and The Grenadines', 'VC'], |
||
| 199 | ['Venezuela', 'VE'], |
||
| 200 | ['British Virgin Islands', 'VG'], |
||
| 201 | ['Vietnam', 'VN'], |
||
| 202 | ['Vanuatu', 'VU'], |
||
| 203 | ['Samoa', 'WS'], |
||
| 204 | ['Yemen', 'YE'], |
||
| 205 | ['South Africa', 'ZA'], |
||
| 206 | ['Zambia', 'ZM'], |
||
| 207 | ['Zimbabwe', 'ZW'], |
||
| 208 | ]; |
||
| 211 |