|
10 | 10 | class Country { |
11 | 11 |
|
12 | 12 | use CountryTrait; |
| 13 | + |
13 | 14 |
|
14 | 15 | /** |
15 | | - * Get Country ISO 3 |
16 | | - * @param string|null $mode |
| 16 | + * Alias for getCountryIso3() method |
| 17 | + * |
| 18 | + * @param string|null $mode |
17 | 19 | * @return string|null |
18 | 20 | */ |
19 | | - public static function getCountryIso3($mode = null) |
| 21 | + public static function iso3($mode = null) |
20 | 22 | { |
21 | | - return self::countryIso3()[self::mode($mode)] ?? null; |
| 23 | + return self::getCountryIso3($mode); |
22 | 24 | } |
23 | | - |
| 25 | + |
24 | 26 | /** |
25 | | - * Get Country ISO 2 |
26 | | - * @param string|null $mode |
| 27 | + * Alias for getCountryIso2() method |
| 28 | + * |
| 29 | + * @param string|null $mode |
27 | 30 | * @return string|null |
28 | 31 | */ |
29 | | - public static function getCountryIso2($mode = null) |
| 32 | + public static function iso2($mode = null) |
30 | 33 | { |
31 | | - return self::countryIso2()[self::mode($mode)] ?? null; |
| 34 | + return self::getCountryIso2($mode); |
32 | 35 | } |
33 | 36 |
|
34 | 37 | /** |
35 | | - * Get Country Flags for ISO 3 |
36 | | - * @param string|null $mode |
| 38 | + * Alias for getCountryFlagIso3() method |
| 39 | + * |
| 40 | + * @param string|null $mode |
37 | 41 | * @return string|null |
38 | 42 | */ |
39 | | - public static function getCountryFlagIso3($mode = null) |
| 43 | + public static function flagIso3($mode = null) |
40 | 44 | { |
41 | | - return self::countryFlagIso3()[self::mode($mode)] ?? null; |
| 45 | + return self::getCountryFlagIso3($mode); |
42 | 46 | } |
43 | 47 |
|
44 | 48 | /** |
45 | | - * Get Country Flags for ISO 2 |
46 | | - * @param string|null $mode |
| 49 | + * Alias for getCountryFlagIso2() method |
| 50 | + * |
| 51 | + * @param string|null $mode |
47 | 52 | * @return string|null |
48 | 53 | */ |
49 | | - public static function getCountryFlagIso2($mode = null) |
| 54 | + public static function flagIso2($mode = null) |
50 | 55 | { |
51 | | - return self::countryFlagIso2()[self::mode($mode)] ?? null; |
| 56 | + return self::getCountryFlagIso2($mode); |
52 | 57 | } |
53 | 58 |
|
54 | 59 | /** |
55 | | - * Get Months Data |
| 60 | + * Alias for getMonths() method |
56 | 61 | * |
| 62 | + * @param string|null $mode |
57 | 63 | * @return string|null |
58 | 64 | */ |
59 | | - public static function getMonths($mode = null) |
| 65 | + public static function month($mode = null) |
60 | 66 | { |
61 | | - return self::months()[$mode] ?? null; |
| 67 | + return self::getMonths($mode); |
62 | 68 | } |
63 | 69 |
|
64 | 70 | /** |
65 | | - * Get Week |
66 | | - * @param string|null $mode |
| 71 | + * Alias for getWeeks() method |
| 72 | + * |
| 73 | + * @param string|null $mode |
67 | 74 | * @return string|null |
68 | 75 | */ |
69 | | - public static function getWeeks($mode = null) |
| 76 | + public static function week($mode = null) |
70 | 77 | { |
71 | | - return self::weeks()[$mode] ?? null; |
| 78 | + return self::getWeeks($mode); |
72 | 79 | } |
73 | 80 |
|
74 | 81 | /** |
75 | | - * Get Time Zones |
76 | | - * |
77 | | - * @param string|null $mode |
78 | | - * @param string|null $default |
| 82 | + * Alias for getTimeZone() method |
79 | 83 | * |
| 84 | + * @param string|null $mode |
80 | 85 | * @return string|null |
81 | 86 | */ |
82 | | - public static function getTimeZone($mode = null, ?string $default = 'UTC') |
| 87 | + public static function zone($mode = null) |
83 | 88 | { |
84 | | - $data = self::timeZone(); |
85 | | - |
86 | | - // check if mode is numeric |
87 | | - if(is_numeric($mode)){ |
88 | | - return $data[(int) $mode] ?? $default; |
89 | | - } |
90 | | - |
91 | | - // flip array to get position num |
92 | | - $flip = array_flip($data); |
93 | | - |
94 | | - return $data[$flip[$mode] ?? null] ?? $default; |
| 89 | + return self::getTimeZone($mode); |
95 | 90 | } |
96 | 91 |
|
97 | 92 | /** |
98 | | - * Get Captcha Locale |
99 | | - * @param string|null $mode |
| 93 | + * Alias for getCaptchaLocale() method |
100 | 94 | * |
101 | | - * @return string|null |
| 95 | + * @return array |
102 | 96 | */ |
103 | | - public static function getCaptchaLocale($mode = null) |
| 97 | + public static function captcha() |
104 | 98 | { |
105 | | - $data = self::captchaLocale(); |
106 | | - |
107 | | - return $data[$mode] |
108 | | - ?? array_flip($data)[$mode] |
109 | | - ?? null; |
| 99 | + return self::getCaptchaLocale(); |
110 | 100 | } |
| 101 | + |
111 | 102 |
|
112 | 103 | } |
0 commit comments