@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | private function optimizeCountriesData($all_countries_data) |
53 | 53 | { |
54 | 54 | $str_length = strlen($all_countries_data) - 4; |
55 | - $all_countries_trimmed_data = substr($all_countries_data, 0, 2).substr($all_countries_data, 3, $str_length); |
|
55 | + $all_countries_trimmed_data = substr($all_countries_data, 0, 2) . substr($all_countries_data, 3, $str_length); |
|
56 | 56 | $hash = new Encrypter($this->en_key, $this->cipher); |
57 | 57 | |
58 | 58 | return $hash->decrypt($all_countries_trimmed_data); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | private function optimizeStatesData($all_states_data) |
82 | 82 | { |
83 | 83 | $str_length = strlen($all_states_data) - 15; |
84 | - $all_states_trimmed_data = substr($all_states_data, 0, 14).substr($all_states_data, 15, $str_length); |
|
84 | + $all_states_trimmed_data = substr($all_states_data, 0, 14) . substr($all_states_data, 15, $str_length); |
|
85 | 85 | |
86 | 86 | return unserialize($all_states_trimmed_data); |
87 | 87 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | } |
170 | 170 | $states = $this->formatStatesData(); |
171 | 171 | |
172 | - return array_values(array_filter($states, function ($item) use ($search_key) { |
|
172 | + return array_values(array_filter($states, function($item) use ($search_key) { |
|
173 | 173 | return starts_with(strtolower($item['state']), strtolower($search_key)); |
174 | 174 | })); |
175 | 175 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | { |
184 | 184 | $countries = $this->getOptimizedCountriesData(); |
185 | 185 | |
186 | - return array_map(function ($item) { |
|
186 | + return array_map(function($item) { |
|
187 | 187 | return $item['country_name']; |
188 | 188 | }, $countries); |
189 | 189 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | } |
203 | 203 | $states = $this->formatStatesData(); |
204 | 204 | |
205 | - return array_values(array_filter($states, function ($item) use ($country_name) { |
|
205 | + return array_values(array_filter($states, function($item) use ($country_name) { |
|
206 | 206 | return strtolower($item['country']) == strtolower($country_name); |
207 | 207 | })); |
208 | 208 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | private function optimizeStdCodesData($all_std_codes_data) |
52 | 52 | { |
53 | 53 | $str_length = strlen($all_std_codes_data) - 4; |
54 | - $all_std_codes_trimmed_data = substr($all_std_codes_data, 0, 2).substr($all_std_codes_data, 3, $str_length); |
|
54 | + $all_std_codes_trimmed_data = substr($all_std_codes_data, 0, 2) . substr($all_std_codes_data, 3, $str_length); |
|
55 | 55 | $hash = new Encrypter($this->en_key, $this->cipher); |
56 | 56 | |
57 | 57 | return $hash->decrypt($all_std_codes_trimmed_data); |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | } |
95 | 95 | $std_codes = $this->getOptimizedStdCodesData(); |
96 | 96 | |
97 | - return collect($std_codes)->filter(function ($item) use ($search_string) { |
|
97 | + return collect($std_codes)->filter(function($item) use ($search_string) { |
|
98 | 98 | return (substr(strtolower($item['country_name']), 0, strlen($search_string)) == strtolower($search_string)) || |
99 | 99 | (strtolower($item['country_code']) == strtolower($search_string)) || |
100 | 100 | (strpos(strtolower($item['std_code']), strtolower($search_string)) !== false); |
101 | - })->transform(function ($value) { |
|
101 | + })->transform(function($value) { |
|
102 | 102 | return array_except($value, 'id'); |
103 | 103 | })->values(); |
104 | 104 | } |
@@ -117,9 +117,9 @@ discard block |
||
117 | 117 | } |
118 | 118 | $std_codes = $this->getOptimizedStdCodesData(); |
119 | 119 | |
120 | - return collect($std_codes)->filter(function ($item) use ($country_name) { |
|
120 | + return collect($std_codes)->filter(function($item) use ($country_name) { |
|
121 | 121 | return substr(strtolower($item['country_name']), 0, strlen($country_name)) == strtolower($country_name); |
122 | - })->transform(function ($value) { |
|
122 | + })->transform(function($value) { |
|
123 | 123 | return array_except($value, 'id'); |
124 | 124 | })->values(); |
125 | 125 | } |
@@ -138,9 +138,9 @@ discard block |
||
138 | 138 | } |
139 | 139 | $std_codes = $this->getOptimizedStdCodesData(); |
140 | 140 | |
141 | - return collect($std_codes)->filter(function ($item) use ($country_code) { |
|
141 | + return collect($std_codes)->filter(function($item) use ($country_code) { |
|
142 | 142 | return strtolower($item['country_code']) == strtolower($country_code); |
143 | - })->transform(function ($value) { |
|
143 | + })->transform(function($value) { |
|
144 | 144 | return array_except($value, 'id'); |
145 | 145 | })->values(); |
146 | 146 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function register() |
23 | 23 | { |
24 | - $this->app->bind('bs-world', function () { |
|
24 | + $this->app->bind('bs-world', function() { |
|
25 | 25 | return new World(new DataRepository()); |
26 | 26 | }); |
27 | 27 | } |
@@ -34,6 +34,6 @@ discard block |
||
34 | 34 | public function boot() |
35 | 35 | { |
36 | 36 | // $this->loadRoutesFrom(__DIR__ . '/routes/routes.php'); |
37 | - $this->publishes([__DIR__.'/Config/world.php' => config_path('world.php')], 'config'); |
|
37 | + $this->publishes([__DIR__ . '/Config/world.php' => config_path('world.php')], 'config'); |
|
38 | 38 | } |
39 | 39 | } |
@@ -31,20 +31,20 @@ |
||
31 | 31 | $prev_page_url = null; |
32 | 32 | } else { |
33 | 33 | $from = ($page_number * $per_page) - $per_page; |
34 | - $prev_page_url = $request_url.'?page='.($page_number - 1); |
|
34 | + $prev_page_url = $request_url . '?page=' . ($page_number - 1); |
|
35 | 35 | } |
36 | 36 | if ($page_number >= $ceil_val) { |
37 | 37 | $next_page_url = null; |
38 | 38 | } else { |
39 | - $next_page_url = $request_url.'?page='.($page_number + 1); |
|
39 | + $next_page_url = $request_url . '?page=' . ($page_number + 1); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | return [ |
43 | - 'current_page' => (int) $page_number, |
|
44 | - 'first_page_url' => $request_url.'?page=1', |
|
43 | + 'current_page' => (int)$page_number, |
|
44 | + 'first_page_url' => $request_url . '?page=1', |
|
45 | 45 | 'from' => $from, |
46 | 46 | 'last_page' => $ceil_val, |
47 | - 'last_page_url' => $request_url.'?page='.$ceil_val, |
|
47 | + 'last_page_url' => $request_url . '?page=' . $ceil_val, |
|
48 | 48 | 'next_page_url' => $next_page_url, |
49 | 49 | 'path' => $request_url, |
50 | 50 | 'per_page' => $per_page, |
@@ -31,20 +31,20 @@ |
||
31 | 31 | $prev_page_url = null; |
32 | 32 | } else { |
33 | 33 | $from = ($page_number * $per_page) - $per_page; |
34 | - $prev_page_url = $request_url.'?page='.($page_number - 1); |
|
34 | + $prev_page_url = $request_url . '?page=' . ($page_number - 1); |
|
35 | 35 | } |
36 | 36 | if ($page_number >= $ceil_val) { |
37 | 37 | $next_page_url = null; |
38 | 38 | } else { |
39 | - $next_page_url = $request_url.'?page='.($page_number + 1); |
|
39 | + $next_page_url = $request_url . '?page=' . ($page_number + 1); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | return [ |
43 | - 'current_page' => (int) $page_number, |
|
44 | - 'first_page_url' => $request_url.'?page=1', |
|
43 | + 'current_page' => (int)$page_number, |
|
44 | + 'first_page_url' => $request_url . '?page=1', |
|
45 | 45 | 'from' => $from, |
46 | 46 | 'last_page' => $ceil_val, |
47 | - 'last_page_url' => $request_url.'?page='.$ceil_val, |
|
47 | + 'last_page_url' => $request_url . '?page=' . $ceil_val, |
|
48 | 48 | 'next_page_url' => $next_page_url, |
49 | 49 | 'path' => $request_url, |
50 | 50 | 'per_page' => $per_page, |
@@ -5,7 +5,7 @@ |
||
5 | 5 | * Date: 07/08/2018 |
6 | 6 | * Time: 01:39 AM. |
7 | 7 | */ |
8 | -Route::get('getWorldCountriesPackageInfo', function () { |
|
8 | +Route::get('getWorldCountriesPackageInfo', function() { |
|
9 | 9 | return [ |
10 | 10 | 'package_name' => 'Laravel - My World', |
11 | 11 | 'description' => 'Laravel WorldCountries is a bundle for Laravel, providing useful world information that is all country names, timezones, ISO country codes, STD codes of countries etc. |