@@ -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 | { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | private function createMacros() |
| 70 | 70 | { |
| 71 | - static::macro('hydrate', function ($elements) { |
|
| 71 | + static::macro('hydrate', function($elements) { |
|
| 72 | 72 | return CountriesFacade::hydrate($this, $elements); |
| 73 | 73 | }); |
| 74 | 74 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | return $this->items[$key]; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - if (! in_array($key, static::$proxies)) { |
|
| 98 | + if (!in_array($key, static::$proxies)) { |
|
| 99 | 99 | throw new Exception("Property [{$key}] does not exist on this collection instance."); |
| 100 | 100 | } |
| 101 | 101 | |
@@ -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); |
@@ -93,9 +93,9 @@ |
||
| 93 | 93 | { |
| 94 | 94 | $result = $this->generateExportData($this->readSourceFile()); |
| 95 | 95 | |
| 96 | - collect($result)->map(function ($item) { |
|
| 96 | + collect($result)->map(function($item) { |
|
| 97 | 97 | return $this->normalize($item); |
| 98 | - })->groupBy('grouping')->each(function ($item, $key) { |
|
| 98 | + })->groupBy('grouping')->each(function($item, $key) { |
|
| 99 | 99 | file_put_contents($this->makeStateFileName($key), json_encode($item)); |
| 100 | 100 | }); |
| 101 | 101 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | protected function canHydrate($element, $enabled, $countryCode) |
| 25 | 25 | { |
| 26 | 26 | return ($enabled || config('countries.hydrate.elements.'.$element)) && |
| 27 | - ! isset($this->repository->countries[$countryCode]['hydrated'][$element]); |
|
| 27 | + !isset($this->repository->countries[$countryCode]['hydrated'][$element]); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | protected function createHydrated($countryCode) |
| 45 | 45 | { |
| 46 | - if (! isset($this->repository->countries[$countryCode]['hydrated'])) { |
|
| 46 | + if (!isset($this->repository->countries[$countryCode]['hydrated'])) { |
|
| 47 | 47 | $this->repository->countries[$countryCode]['hydrated'] = []; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | protected function needsHydration($countryCode, $element, $enabled = false) |
| 62 | 62 | { |
| 63 | - if (! $this->canHydrate($element, $enabled, $countryCode)) { |
|
| 63 | + if (!$this->canHydrate($element, $enabled, $countryCode)) { |
|
| 64 | 64 | return false; |
| 65 | 65 | } |
| 66 | 66 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | protected function getHydrationElements($elements) |
| 127 | 127 | { |
| 128 | - if (! is_array($elements = $elements ?: config('countries.hydrate.elements'))) { |
|
| 128 | + if (!is_array($elements = $elements ?: config('countries.hydrate.elements'))) { |
|
| 129 | 129 | return [$elements => true]; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | protected function hydrateBorders($country) |
| 155 | 155 | { |
| 156 | - $country['borders'] = collect($country['borders'])->map(function ($border) { |
|
| 156 | + $country['borders'] = collect($country['borders'])->map(function($border) { |
|
| 157 | 157 | $border = $this->repository->call('where', ['cca3', $border]); |
| 158 | 158 | |
| 159 | 159 | if ($border instanceof Collection && $border->count() == 1) { |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | protected function hydrateTimezone($country) |
| 176 | 176 | { |
| 177 | - if (! isset($this->repository->timezones[$country['cca2']])) { |
|
| 177 | + if (!isset($this->repository->timezones[$country['cca2']])) { |
|
| 178 | 178 | return $country; |
| 179 | 179 | } |
| 180 | 180 | |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | protected function hydrateCurrency($country) |
| 193 | 193 | { |
| 194 | - $country['currency'] = collect($country['currency'])->map(function ($code) { |
|
| 194 | + $country['currency'] = collect($country['currency'])->map(function($code) { |
|
| 195 | 195 | return $this->repository->currenciesRepository->loadCurrency($code); |
| 196 | 196 | }); |
| 197 | 197 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | $elements = $this->getHydrationElements($elements); |
| 211 | 211 | |
| 212 | 212 | return $this->repository->collection( |
| 213 | - $countries->map(function ($country) use ($elements) { |
|
| 213 | + $countries->map(function($country) use ($elements) { |
|
| 214 | 214 | $country = $this->toArray($country); |
| 215 | 215 | |
| 216 | 216 | $countryCode = $country['cca3']; |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | */ |
| 246 | 246 | public function addCountry($countryCode, $country) |
| 247 | 247 | { |
| 248 | - if (! isset($this->repository->countries[$countryCode])) { |
|
| 248 | + if (!isset($this->repository->countries[$countryCode])) { |
|
| 249 | 249 | $this->repository->countries[$countryCode] = $country; |
| 250 | 250 | } |
| 251 | 251 | } |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | */ |
| 273 | 273 | protected function checkHydrationElements($elements) |
| 274 | 274 | { |
| 275 | - $elements = collect($elements)->mapWithKeys(function ($value, $key) { |
|
| 275 | + $elements = collect($elements)->mapWithKeys(function($value, $key) { |
|
| 276 | 276 | if (is_numeric($key)) { |
| 277 | 277 | $key = $value; |
| 278 | 278 | $value = true; |