Test Setup Failed
Branch dev (451d27)
by Someshwer
02:38
created
src/Helpers/MyPaginate.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,11 @@
 block discarded – undo
32 32
             $from = ($page_number * $per_page) - $per_page;
33 33
             $prev_page_url = $request_url . "?page=" . ($page_number - 1);
34 34
         }
35
-        if ($page_number >= $ceil_val) $next_page_url = null;
36
-        else $next_page_url = $request_url . "?page=" . ($page_number + 1);
35
+        if ($page_number >= $ceil_val) {
36
+            $next_page_url = null;
37
+        } else {
38
+            $next_page_url = $request_url . "?page=" . ($page_number + 1);
39
+        }
37 40
         return [
38 41
             'current_page' => (int)$page_number,
39 42
             'first_page_url' => $request_url . "?page=1",
Please login to merge, or discard this patch.
src/Helpers/MyPaginator.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,11 @@
 block discarded – undo
34 34
             $from = ($page_number * $per_page) - $per_page;
35 35
             $prev_page_url = $request_url . "?page=" . ($page_number - 1);
36 36
         }
37
-        if ($page_number >= $ceil_val) $next_page_url = null;
38
-        else $next_page_url = $request_url . "?page=" . ($page_number + 1);
37
+        if ($page_number >= $ceil_val) {
38
+            $next_page_url = null;
39
+        } else {
40
+            $next_page_url = $request_url . "?page=" . ($page_number + 1);
41
+        }
39 42
         return [
40 43
             'current_page' => (int)$page_number,
41 44
             'first_page_url' => $request_url . "?page=1",
Please login to merge, or discard this patch.
src/Utils/Wonders.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
      */
70 70
     private function formatWonders($wonders)
71 71
     {
72
-        return collect($wonders)->transform(function ($item, $key) {
72
+        return collect($wonders)->transform(function($item, $key) {
73 73
             $data['name'] = $key;
74 74
             $data['display_name'] = str_replace('_', ' ', title_case($key));
75 75
             $data['location'] = str_replace('_', ' ', title_case($item));
Please login to merge, or discard this patch.
src/Utils/Continents.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
      */
77 77
     private function formatContinents($continents)
78 78
     {
79
-        return collect($continents)->transform(function ($item) {
79
+        return collect($continents)->transform(function($item) {
80 80
             $data['name'] = $item;
81 81
             $data['display_name'] = str_replace('_', ' ', title_case($item));
82 82
             $data['also_called_as'] = ($item == 'australia') ? 'Oceania' : null;
Please login to merge, or discard this patch.
src/Utils/Oceans.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
      */
74 74
     private function formatOceans($oceans)
75 75
     {
76
-        return collect($oceans)->transform(function ($item) {
76
+        return collect($oceans)->transform(function($item) {
77 77
             $data['name'] = $item;
78 78
             $data['display_name'] = title_case($item);
79 79
             $data['also_called_as'] = ($item == 'antarctic') ? 'Southern Ocean' : null;
Please login to merge, or discard this patch.
src/Utils/UnionTerritories.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
      */
74 74
     private function formatTerritories($territories)
75 75
     {
76
-        return collect($territories)->transform(function ($item, $key) {
76
+        return collect($territories)->transform(function($item, $key) {
77 77
             $data['name'] = $key;
78 78
             $data['display_name'] = str_replace('_', ' ', title_case($key));
79 79
             $data['capital'] = str_replace('_', ' ', title_case($item));
Please login to merge, or discard this patch.
src/WorldDataServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Lib/ISOCodes.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     private function filterRegions($regions, $region)
118 118
     {
119
-        return collect($regions)->filter(function ($item, $key) use ($region) {
119
+        return collect($regions)->filter(function($item, $key) use ($region) {
120 120
             return ($region == null) ? true : (strpos(strtolower($key), strtolower($region)) === 0) ? true : false;
121 121
         });
122 122
     }
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         $iso_codes = $this->getOptimizedIsoData();
162 162
         $regions_data = $this->formatRegions($iso_codes);
163 163
         $regions = array_keys($regions_data);
164
-        return collect($regions)->map(function ($item) {
164
+        return collect($regions)->map(function($item) {
165 165
             return ['key' => strtolower($item), 'name' => $item];
166 166
         });
167 167
     }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
     {
178 178
         if ($key == null) return [];
179 179
         $iso_data = $this->getOptimizedIsoData();
180
-        return array_values(array_filter($iso_data, function ($item) use ($key) {
180
+        return array_values(array_filter($iso_data, function($item) use ($key) {
181 181
             return (str_contains(strtolower($item['name']), strtolower($key)) ||
182 182
                 str_contains(strtolower($item['alpha_2']), strtolower($key)) ||
183 183
                 str_contains(strtolower($item['alpha_3']), strtolower($key)) ||
@@ -194,11 +194,11 @@  discard block
 block discarded – undo
194 194
      */
195 195
     private function filterIsoInfoByCountryName($iso_codes, $name)
196 196
     {
197
-        return collect($iso_codes)->map(function ($item, $key) {
197
+        return collect($iso_codes)->map(function($item, $key) {
198 198
             $item['display_name'] = $item['name'];
199 199
             $item['name'] = strtolower(studly_case($item['name']));
200 200
             return $item;
201
-        })->groupBy('name')->filter(function ($item, $key) use ($name) {
201
+        })->groupBy('name')->filter(function($item, $key) use ($name) {
202 202
             return strpos($key, $name) === 0;
203 203
         })->collapse();
204 204
     }
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -175,7 +175,9 @@  discard block
 block discarded – undo
175 175
      */
176 176
     public function searchIsoCodes($key = null)
177 177
     {
178
-        if ($key == null) return [];
178
+        if ($key == null) {
179
+            return [];
180
+        }
179 181
         $iso_data = $this->getOptimizedIsoData();
180 182
         return array_values(array_filter($iso_data, function ($item) use ($key) {
181 183
             return (str_contains(strtolower($item['name']), strtolower($key)) ||
@@ -211,10 +213,14 @@  discard block
 block discarded – undo
211 213
      */
212 214
     public function isoInfoByCountryName($name = null)
213 215
     {
214
-        if ($name == null) return [];
216
+        if ($name == null) {
217
+            return [];
218
+        }
215 219
         $iso_codes = $this->getOptimizedIsoData();
216 220
         $result = $this->filterIsoInfoByCountryName($iso_codes, $name);
217
-        if ($result == null) return [];
221
+        if ($result == null) {
222
+            return [];
223
+        }
218 224
         return $result;
219 225
     }
220 226
 
Please login to merge, or discard this patch.
src/Lib/Cities.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             return [];
175 175
         }
176 176
         $cities = $this->formatCitiesData();
177
-        return array_values(array_filter($cities, function ($item) use ($search_key) {
177
+        return array_values(array_filter($cities, function($item) use ($search_key) {
178 178
             return starts_with(strtolower($item['city']), strtolower($search_key));
179 179
         }));
180 180
     }
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
     public function statesForCities()
189 189
     {
190 190
         $states = $this->getOptimizedStatesData();
191
-        return array_map(function ($item) {
191
+        return array_map(function($item) {
192 192
             return $item['state_name'];
193 193
         }, $states);
194 194
     }
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
     public function countriesForCities()
203 203
     {
204 204
         $countries = $this->getOptimizedCountriesData();
205
-        return array_map(function ($item) {
205
+        return array_map(function($item) {
206 206
             return $item['country_name'];
207 207
         }, $countries);
208 208
     }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
             return [];
220 220
         }
221 221
         $cities = $this->formatCitiesData();
222
-        return array_values(array_filter($cities, function ($item) use ($state_name) {
222
+        return array_values(array_filter($cities, function($item) use ($state_name) {
223 223
             return strtolower($item['state']) == strtolower($state_name);
224 224
         }));
225 225
     }
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
             return [];
237 237
         }
238 238
         $cities = $this->formatCitiesData();
239
-        return array_values(array_filter($cities, function ($item) use ($country_name) {
239
+        return array_values(array_filter($cities, function($item) use ($country_name) {
240 240
             return strtolower($item['country']) == strtolower($country_name);
241 241
         }));
242 242
     }
Please login to merge, or discard this patch.