@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * |
21 | 21 | * @param callable|null $callback |
22 | 22 | * @param null $default |
23 | - * @return mixed|Collection |
|
23 | + * @return Collection |
|
24 | 24 | */ |
25 | 25 | public function first(callable $callback = null, $default = null) |
26 | 26 | { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | /** |
31 | 31 | * Get and remove the last item from the collection. |
32 | 32 | * |
33 | - * @return mixed |
|
33 | + * @return Collection |
|
34 | 34 | */ |
35 | 35 | public function pop() |
36 | 36 | { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | /** |
53 | 53 | * Get and remove the first item from the collection. |
54 | 54 | * |
55 | - * @return mixed |
|
55 | + * @return Collection |
|
56 | 56 | */ |
57 | 57 | public function shift() |
58 | 58 | { |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | return $this->items[$key]; |
82 | 82 | } |
83 | 83 | |
84 | - if (! in_array($key, static::$proxies)) { |
|
84 | + if (!in_array($key, static::$proxies)) { |
|
85 | 85 | throw new Exception("Property [{$key}] does not exist on this collection instance."); |
86 | 86 | } |
87 | 87 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | private function createMacros() |
92 | 92 | { |
93 | - static::macro('hydrate', function ($elements) { |
|
93 | + static::macro('hydrate', function($elements) { |
|
94 | 94 | return CountriesFacade::hydrate($this, $elements); |
95 | 95 | }); |
96 | 96 | } |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | */ |
35 | 35 | protected function needsHydration($cc, $element, $enabled = false) |
36 | 36 | { |
37 | - if (! $enabled && ! config('countries.hydrate.elements.'.$element)) { |
|
37 | + if (!$enabled && !config('countries.hydrate.elements.'.$element)) { |
|
38 | 38 | return false; |
39 | 39 | } |
40 | 40 | |
41 | - if (! isset($this->repository->countries[$cc]['hydrated'])) { |
|
41 | + if (!isset($this->repository->countries[$cc]['hydrated'])) { |
|
42 | 42 | $this->repository->countries[$cc]['hydrated'] = []; |
43 | 43 | } |
44 | 44 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | protected function getHydrationElements($elements) |
115 | 115 | { |
116 | - if (! is_array($elements = $elements ?: config('countries.hydrate.elements'))) { |
|
116 | + if (!is_array($elements = $elements ?: config('countries.hydrate.elements'))) { |
|
117 | 117 | return [$elements => true]; |
118 | 118 | } |
119 | 119 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | protected function hydrateBorders($country) |
143 | 143 | { |
144 | - $country['borders'] = collect($country['borders'])->map(function ($border) { |
|
144 | + $country['borders'] = collect($country['borders'])->map(function($border) { |
|
145 | 145 | $border = $this->repository->call('where', ['cca3', $border]); |
146 | 146 | |
147 | 147 | if ($border instanceof Collection && $border->count() == 1) { |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | protected function hydrateTimezone($country) |
164 | 164 | { |
165 | - if (! isset($this->repository->timezones[$country['cca2']])) { |
|
165 | + if (!isset($this->repository->timezones[$country['cca2']])) { |
|
166 | 166 | return $country; |
167 | 167 | } |
168 | 168 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | */ |
180 | 180 | protected function hydrateCurrency($country) |
181 | 181 | { |
182 | - $country['currency'] = collect($country['currency'])->map(function ($code) { |
|
182 | + $country['currency'] = collect($country['currency'])->map(function($code) { |
|
183 | 183 | return $this->repository->currenciesRepository->loadCurrency($code); |
184 | 184 | }); |
185 | 185 | |
@@ -198,10 +198,10 @@ discard block |
||
198 | 198 | $elements = $this->getHydrationElements($elements); |
199 | 199 | |
200 | 200 | return $this->repository->collection( |
201 | - $countries->map(function ($country) use ($elements) { |
|
201 | + $countries->map(function($country) use ($elements) { |
|
202 | 202 | $country = $this->toArray($country); |
203 | 203 | |
204 | - if (! isset($this->repository->countries[$cc = $country['cca3']])) { |
|
204 | + if (!isset($this->repository->countries[$cc = $country['cca3']])) { |
|
205 | 205 | $this->repository->countries[$cc] = $country; |
206 | 206 | } |
207 | 207 | |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | */ |
225 | 225 | protected function checkHydrationElements($elements) |
226 | 226 | { |
227 | - $elements = collect($elements)->mapWithKeys(function ($value, $key) { |
|
227 | + $elements = collect($elements)->mapWithKeys(function($value, $key) { |
|
228 | 228 | if (is_numeric($key)) { |
229 | 229 | $key = $value; |
230 | 230 | $value = true; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $counter = -1; |
60 | 60 | |
61 | 61 | foreach ($file as $line) { |
62 | - if (! trim($line)) { |
|
62 | + if (!trim($line)) { |
|
63 | 63 | continue; |
64 | 64 | } |
65 | 65 | |
@@ -76,9 +76,9 @@ discard block |
||
76 | 76 | $result[$counter][$field] = $value; |
77 | 77 | } |
78 | 78 | |
79 | - collect($result)->map(function ($item) { |
|
79 | + collect($result)->map(function($item) { |
|
80 | 80 | return $this->normalize($item); |
81 | - })->groupBy('grouping')->each(function ($item, $key) { |
|
81 | + })->groupBy('grouping')->each(function($item, $key) { |
|
82 | 82 | file_put_contents($this->makeStateFileName($key), json_encode($item)); |
83 | 83 | }); |
84 | 84 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | $depth = 0; |
14 | 14 | |
15 | - while (! file_exists($dir.DIRECTORY_SEPARATOR.'composer.json') && $depth < 16) { |
|
15 | + while (!file_exists($dir.DIRECTORY_SEPARATOR.'composer.json') && $depth < 16) { |
|
16 | 16 | $dir .= DIRECTORY_SEPARATOR.'..'; |
17 | 17 | |
18 | 18 | $depth++; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | function array_is_multidimensional($item) |
44 | 44 | { |
45 | - if (! is_array($item)) { |
|
45 | + if (!is_array($item)) { |
|
46 | 46 | return false; |
47 | 47 | } |
48 | 48 |
@@ -70,7 +70,7 @@ |
||
70 | 70 | |
71 | 71 | $hydrator = new Hydrator(); |
72 | 72 | |
73 | - $this->app->singleton('pragmarx.countries', function () use ($cache, $hydrator) { |
|
73 | + $this->app->singleton('pragmarx.countries', function() use ($cache, $hydrator) { |
|
74 | 74 | $repository = new CountriesRepository($cache, new CurrenciesRepository(), $hydrator); |
75 | 75 | |
76 | 76 | $hydrator->setRepository($repository); |