@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | private function optimizeContinentsData($all_continents_data) |
64 | 64 | { |
65 | 65 | $str_length = strlen($all_continents_data) - 4; |
66 | - $all_continents_trimmed_data = substr($all_continents_data, 0, 2).substr($all_continents_data, 3, $str_length); |
|
66 | + $all_continents_trimmed_data = substr($all_continents_data, 0, 2) . substr($all_continents_data, 3, $str_length); |
|
67 | 67 | // $hash = new Encrypter($this->en_key, Config::get('app.cipher')); |
68 | 68 | $hash = new Encrypter($this->en_key, $this->cipher); |
69 | 69 | $all_continents = $hash->decrypt($all_continents_trimmed_data); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | private function formatContinents($continents) |
82 | 82 | { |
83 | - return collect($continents)->transform(function ($item) { |
|
83 | + return collect($continents)->transform(function($item) { |
|
84 | 84 | $data['name'] = $item; |
85 | 85 | $data['display_name'] = str_replace('_', ' ', title_case($item)); |
86 | 86 | $data['also_called_as'] = ($item == 'australia') ? 'Oceania' : null; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | private function optimizeWondersData($all_wonders_data) |
46 | 46 | { |
47 | 47 | $str_length = strlen($all_wonders_data) - 4; |
48 | - $all_wonders_trimmed_data = substr($all_wonders_data, 0, 2).substr($all_wonders_data, 3, $str_length); |
|
48 | + $all_wonders_trimmed_data = substr($all_wonders_data, 0, 2) . substr($all_wonders_data, 3, $str_length); |
|
49 | 49 | $hash = new Encrypter($this->en_key, $this->cipher); |
50 | 50 | |
51 | 51 | return $hash->decrypt($all_wonders_trimmed_data); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | private function formatWonders($wonders) |
75 | 75 | { |
76 | - return collect($wonders)->transform(function ($item, $key) { |
|
76 | + return collect($wonders)->transform(function($item, $key) { |
|
77 | 77 | $data['name'] = $key; |
78 | 78 | $data['display_name'] = str_replace('_', ' ', title_case($key)); |
79 | 79 | $data['location'] = str_replace('_', ' ', title_case($item)); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | private function optimizeTerritoriesData($all_territories_data) |
51 | 51 | { |
52 | 52 | $str_length = strlen($all_territories_data) - 4; |
53 | - $all_territories_trimmed_data = substr($all_territories_data, 0, 2).substr($all_territories_data, 3, $str_length); |
|
53 | + $all_territories_trimmed_data = substr($all_territories_data, 0, 2) . substr($all_territories_data, 3, $str_length); |
|
54 | 54 | $hash = new Encrypter($this->en_key, $this->cipher); |
55 | 55 | |
56 | 56 | return $hash->decrypt($all_territories_trimmed_data); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | private function formatTerritories($territories) |
80 | 80 | { |
81 | - return collect($territories)->transform(function ($item, $key) { |
|
81 | + return collect($territories)->transform(function($item, $key) { |
|
82 | 82 | $data['name'] = $key; |
83 | 83 | $data['display_name'] = str_replace('_', ' ', title_case($key)); |
84 | 84 | $data['capital'] = str_replace('_', ' ', title_case($item)); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | private function optimizeOceansData($all_oceans_data) |
51 | 51 | { |
52 | 52 | $str_length = strlen($all_oceans_data) - 4; |
53 | - $all_oceans_trimmed_data = substr($all_oceans_data, 0, 2).substr($all_oceans_data, 3, $str_length); |
|
53 | + $all_oceans_trimmed_data = substr($all_oceans_data, 0, 2) . substr($all_oceans_data, 3, $str_length); |
|
54 | 54 | $hash = new Encrypter($this->en_key, $this->cipher); |
55 | 55 | |
56 | 56 | return $hash->decrypt($all_oceans_trimmed_data); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | private function formatOceans($oceans) |
80 | 80 | { |
81 | - return collect($oceans)->transform(function ($item) { |
|
81 | + return collect($oceans)->transform(function($item) { |
|
82 | 82 | $data['name'] = $item; |
83 | 83 | $data['display_name'] = title_case($item); |
84 | 84 | $data['also_called_as'] = ($item == 'antarctic') ? 'Southern Ocean' : null; |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @var string |
23 | 23 | */ |
24 | - private $base_path = __DIR__.'/../Res/'; |
|
24 | + private $base_path = __DIR__ . '/../Res/'; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * This method contains countries data |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function countries() |
33 | 33 | { |
34 | - $path = $this->base_path.'country_names.txt'; |
|
34 | + $path = $this->base_path . 'country_names.txt'; |
|
35 | 35 | |
36 | 36 | return File::get($path); |
37 | 37 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function countriesISOData() |
45 | 45 | { |
46 | - $path = $this->base_path.'country_iso.txt'; |
|
46 | + $path = $this->base_path . 'country_iso.txt'; |
|
47 | 47 | |
48 | 48 | return File::get($path); |
49 | 49 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function continents() |
57 | 57 | { |
58 | - $path = $path = $this->base_path.'continents.txt'; |
|
58 | + $path = $path = $this->base_path . 'continents.txt'; |
|
59 | 59 | |
60 | 60 | return File::get($path); |
61 | 61 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function oceans() |
69 | 69 | { |
70 | - $path = $path = $this->base_path.'oceans.txt'; |
|
70 | + $path = $path = $this->base_path . 'oceans.txt'; |
|
71 | 71 | |
72 | 72 | return File::get($path); |
73 | 73 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function unionTerritories() |
81 | 81 | { |
82 | - $path = $path = $this->base_path.'territories.txt'; |
|
82 | + $path = $path = $this->base_path . 'territories.txt'; |
|
83 | 83 | |
84 | 84 | return File::get($path); |
85 | 85 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function wonders() |
93 | 93 | { |
94 | - $path = $path = $this->base_path.'wonders.txt'; |
|
94 | + $path = $path = $this->base_path . 'wonders.txt'; |
|
95 | 95 | |
96 | 96 | return File::get($path); |
97 | 97 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function currencies() |
119 | 119 | { |
120 | - $path = $path = $this->base_path.'currencies.txt'; |
|
120 | + $path = $path = $this->base_path . 'currencies.txt'; |
|
121 | 121 | |
122 | 122 | return File::get($path); |
123 | 123 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | */ |
130 | 130 | public function stdCodes() |
131 | 131 | { |
132 | - $path = $path = $this->base_path.'std_codes.txt'; |
|
132 | + $path = $path = $this->base_path . 'std_codes.txt'; |
|
133 | 133 | |
134 | 134 | return File::get($path); |
135 | 135 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | public function states() |
143 | 143 | { |
144 | - $path = $path = $this->base_path.'states.txt'; |
|
144 | + $path = $path = $this->base_path . 'states.txt'; |
|
145 | 145 | |
146 | 146 | return File::get($path); |
147 | 147 | } |
@@ -153,14 +153,14 @@ discard block |
||
153 | 153 | */ |
154 | 154 | public function countriesHelper() |
155 | 155 | { |
156 | - $path = $path = $this->base_path.'countries_helper.txt'; |
|
156 | + $path = $path = $this->base_path . 'countries_helper.txt'; |
|
157 | 157 | |
158 | 158 | return File::get($path); |
159 | 159 | } |
160 | 160 | |
161 | 161 | public function cities() |
162 | 162 | { |
163 | - $path = $path = $this->base_path.'cities.txt'; |
|
163 | + $path = $path = $this->base_path . 'cities.txt'; |
|
164 | 164 | |
165 | 165 | return File::get($path); |
166 | 166 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | private function optimizeCountryData($all_countries_data) |
52 | 52 | { |
53 | 53 | $str_length = strlen($all_countries_data) - 4; |
54 | - $all_countries_trimmed_data = substr($all_countries_data, 0, 2).substr($all_countries_data, 3, $str_length); |
|
54 | + $all_countries_trimmed_data = substr($all_countries_data, 0, 2) . substr($all_countries_data, 3, $str_length); |
|
55 | 55 | // $hash = new Encrypter($this->en_key, Config::get('app.cipher')); |
56 | 56 | $hash = new Encrypter($this->en_key, $this->cipher); |
57 | 57 | $all_countries = $hash->decrypt($all_countries_trimmed_data); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | { |
69 | 69 | $all_countries_data = $this->data->countries(); |
70 | 70 | $all_countries = $this->optimizeCountryData($all_countries_data); |
71 | - $countries = collect($all_countries)->map(function ($item) { |
|
71 | + $countries = collect($all_countries)->map(function($item) { |
|
72 | 72 | // return title_case(str_replace('-',' ', $item)); |
73 | 73 | return studly_case($item); |
74 | 74 | }); |
@@ -88,13 +88,13 @@ discard block |
||
88 | 88 | $all_countries_data = $this->data->countries(); |
89 | 89 | $all_countries = $this->optimizeCountryData($all_countries_data); |
90 | 90 | if ($search_string == null) { |
91 | - return array_map(function ($it) { |
|
91 | + return array_map(function($it) { |
|
92 | 92 | return studly_case($it); |
93 | 93 | }, $all_countries); |
94 | 94 | } |
95 | - $countries = array_map(function ($it) { |
|
95 | + $countries = array_map(function($it) { |
|
96 | 96 | return studly_case($it); |
97 | - }, array_filter($all_countries, function ($item) use ($search_string) { |
|
97 | + }, array_filter($all_countries, function($item) use ($search_string) { |
|
98 | 98 | return strpos($item, strtolower($search_string)) === 0; |
99 | 99 | })); |
100 | 100 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | private function optimizeCurrenciesData($all_currencies_data) |
47 | 47 | { |
48 | 48 | $str_length = strlen($all_currencies_data) - 4; |
49 | - $all_currencies_trimmed_data = substr($all_currencies_data, 0, 2).substr($all_currencies_data, 3, $str_length); |
|
49 | + $all_currencies_trimmed_data = substr($all_currencies_data, 0, 2) . substr($all_currencies_data, 3, $str_length); |
|
50 | 50 | $hash = new Encrypter($this->en_key, $this->cipher); |
51 | 51 | |
52 | 52 | return $hash->decrypt($all_currencies_trimmed_data); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | return []; |
90 | 90 | } |
91 | 91 | |
92 | - return collect($this->getOptimizedCurrenciesData())->filter(function ($item) use ($search_key) { |
|
92 | + return collect($this->getOptimizedCurrenciesData())->filter(function($item) use ($search_key) { |
|
93 | 93 | return (strpos(strtolower($item['currency_name']), strtolower($search_key)) !== false) || |
94 | 94 | (strpos(strtolower($item['country_name']), strtolower($search_key)) !== false); |
95 | 95 | })->values(); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | return []; |
109 | 109 | } |
110 | 110 | |
111 | - return collect($this->getOptimizedCurrenciesData())->filter(function ($item) use ($country_name) { |
|
111 | + return collect($this->getOptimizedCurrenciesData())->filter(function($item) use ($country_name) { |
|
112 | 112 | return strtolower($item['country_name']) == strtolower($country_name); |
113 | 113 | })->values(); |
114 | 114 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | return []; |
127 | 127 | } |
128 | 128 | |
129 | - return collect($this->getOptimizedCurrenciesData())->filter(function ($item) use ($country_code) { |
|
129 | + return collect($this->getOptimizedCurrenciesData())->filter(function($item) use ($country_code) { |
|
130 | 130 | return strtolower($item['country_code']) == strtolower($country_code); |
131 | 131 | })->values(); |
132 | 132 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | return []; |
145 | 145 | } |
146 | 146 | |
147 | - return collect($this->getOptimizedCurrenciesData())->filter(function ($item) use ($currency_name) { |
|
147 | + return collect($this->getOptimizedCurrenciesData())->filter(function($item) use ($currency_name) { |
|
148 | 148 | return strpos(strtolower($item['currency_name']), strtolower($currency_name)) !== false; |
149 | 149 | })->values(); |
150 | 150 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | return []; |
163 | 163 | } |
164 | 164 | |
165 | - return collect($this->getOptimizedCurrenciesData())->filter(function ($item) use ($currency_code) { |
|
165 | + return collect($this->getOptimizedCurrenciesData())->filter(function($item) use ($currency_code) { |
|
166 | 166 | return strtolower($item['currency_code']) == strtolower($currency_code); |
167 | 167 | })->values(); |
168 | 168 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | private function optimizeCountriesData($all_countries_data) |
44 | 44 | { |
45 | 45 | $str_length = strlen($all_countries_data) - 4; |
46 | - $all_countries_trimmed_data = substr($all_countries_data, 0, 2).substr($all_countries_data, 3, $str_length); |
|
46 | + $all_countries_trimmed_data = substr($all_countries_data, 0, 2) . substr($all_countries_data, 3, $str_length); |
|
47 | 47 | $hash = new Encrypter($this->en_key, $this->cipher); |
48 | 48 | |
49 | 49 | return $hash->decrypt($all_countries_trimmed_data); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | private function optimizeStatesData($all_states_data) |
73 | 73 | { |
74 | 74 | $str_length = strlen($all_states_data) - 15; |
75 | - $all_states_trimmed_data = substr($all_states_data, 0, 14).substr($all_states_data, 15, $str_length); |
|
75 | + $all_states_trimmed_data = substr($all_states_data, 0, 14) . substr($all_states_data, 15, $str_length); |
|
76 | 76 | |
77 | 77 | return unserialize($all_states_trimmed_data); |
78 | 78 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | private function optimizeCitiesData($all_cities_data) |
101 | 101 | { |
102 | 102 | $str_length = strlen($all_cities_data) - 15; |
103 | - $all_cities_trimmed_data = substr($all_cities_data, 0, 14).substr($all_cities_data, 15, $str_length); |
|
103 | + $all_cities_trimmed_data = substr($all_cities_data, 0, 14) . substr($all_cities_data, 15, $str_length); |
|
104 | 104 | |
105 | 105 | return unserialize($all_cities_trimmed_data); |
106 | 106 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | } |
193 | 193 | $cities = $this->formatCitiesData(); |
194 | 194 | |
195 | - return array_values(array_filter($cities, function ($item) use ($search_key) { |
|
195 | + return array_values(array_filter($cities, function($item) use ($search_key) { |
|
196 | 196 | return starts_with(strtolower($item['city']), strtolower($search_key)); |
197 | 197 | })); |
198 | 198 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | { |
208 | 208 | $states = $this->getOptimizedStatesData(); |
209 | 209 | |
210 | - return array_map(function ($item) { |
|
210 | + return array_map(function($item) { |
|
211 | 211 | return $item['state_name']; |
212 | 212 | }, $states); |
213 | 213 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | { |
223 | 223 | $countries = $this->getOptimizedCountriesData(); |
224 | 224 | |
225 | - return array_map(function ($item) { |
|
225 | + return array_map(function($item) { |
|
226 | 226 | return $item['country_name']; |
227 | 227 | }, $countries); |
228 | 228 | } |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | } |
242 | 242 | $cities = $this->formatCitiesData(); |
243 | 243 | |
244 | - return array_values(array_filter($cities, function ($item) use ($state_name) { |
|
244 | + return array_values(array_filter($cities, function($item) use ($state_name) { |
|
245 | 245 | return strtolower($item['state']) == strtolower($state_name); |
246 | 246 | })); |
247 | 247 | } |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | } |
261 | 261 | $cities = $this->formatCitiesData(); |
262 | 262 | |
263 | - return array_values(array_filter($cities, function ($item) use ($country_name) { |
|
263 | + return array_values(array_filter($cities, function($item) use ($country_name) { |
|
264 | 264 | return strtolower($item['country']) == strtolower($country_name); |
265 | 265 | })); |
266 | 266 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | date_default_timezone_set($zone); |
45 | 45 | $zones_array[$key]['region'] = $zones_array[$key]['region'] = substr($zone, 0, strpos($zone, '/')); |
46 | 46 | $zones_array[$key]['zone'] = $zone; |
47 | - $zones_array[$key]['diff_from_GMT'] = 'UTC/GMT '.date('P', $timestamp); |
|
47 | + $zones_array[$key]['diff_from_GMT'] = 'UTC/GMT ' . date('P', $timestamp); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | return $zones_array; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | return []; |
115 | 115 | } |
116 | 116 | $timezones = $this->prepareTimezones(); |
117 | - $filtered_timezones = collect($timezones)->filter(function ($item) use ($search_key) { |
|
117 | + $filtered_timezones = collect($timezones)->filter(function($item) use ($search_key) { |
|
118 | 118 | return strpos(strtolower($item['zone']), strtolower($search_key)) !== false; |
119 | 119 | })->values(); |
120 | 120 |