| 1 | <?php |
||
| 25 | final class Country |
||
| 26 | { |
||
| 27 | const AUSTRALIA = 'com.au'; |
||
| 28 | const BRAZIL = 'com.br'; |
||
| 29 | const CANADA = 'ca'; |
||
| 30 | const CHINA = 'cn'; |
||
| 31 | const FRANCE = 'fr'; |
||
| 32 | const GERMANY = 'de'; |
||
| 33 | const INDIA = 'in'; |
||
| 34 | const INTERNATIONAL = 'com'; |
||
| 35 | const ITALY = 'it'; |
||
| 36 | const JAPAN = 'co.jp'; |
||
| 37 | const MEXICO = 'com.mx'; |
||
| 38 | const SPAIN = 'es'; |
||
| 39 | const UNITED_KINGDOM = 'co.uk'; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Possible countries |
||
| 43 | * Important for the request endpoints |
||
| 44 | * |
||
| 45 | * @var array |
||
| 46 | */ |
||
| 47 | private static $countryList = [ |
||
| 48 | self::AUSTRALIA, |
||
| 49 | self::BRAZIL, |
||
| 50 | self::CANADA, |
||
| 51 | self::CHINA, |
||
| 52 | self::FRANCE, |
||
| 53 | self::GERMANY, |
||
| 54 | self::INDIA, |
||
| 55 | self::INTERNATIONAL, |
||
| 56 | self::ITALY, |
||
| 57 | self::JAPAN, |
||
| 58 | self::MEXICO, |
||
| 59 | self::SPAIN, |
||
| 60 | self::UNITED_KINGDOM |
||
| 61 | ]; |
||
| 62 | |||
| 63 | /** |
||
| 64 | * Gets all possible countries |
||
| 65 | * |
||
| 66 | * @return array |
||
| 67 | */ |
||
| 68 | 2 | public static function getCountries() |
|
| 72 | |||
| 73 | /** |
||
| 74 | * Checks if the given value is a valid country |
||
| 75 | * |
||
| 76 | * @param string $country |
||
| 77 | * |
||
| 78 | * @return boolean |
||
| 79 | */ |
||
| 80 | 6 | public static function isValidCountry($country) |
|
| 84 | } |
||
| 85 |