@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $dumper = new $dumperClass; |
| 92 | 92 | $results = collect($this->results->all()); |
| 93 | 93 | |
| 94 | - return $results->map(function ($result) use ($dumper) { |
|
| 94 | + return $results->map(function($result) use ($dumper) { |
|
| 95 | 95 | return $dumper->dump($result); |
| 96 | 96 | }); |
| 97 | 97 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | public function geocode(string $value) : self |
| 100 | 100 | { |
| 101 | 101 | $cacheKey = (new Str)->slug(strtolower(urlencode($value))); |
| 102 | - $this->results = $this->cacheRequest($cacheKey, [$value], "geocode"); |
|
| 102 | + $this->results = $this->cacheRequest($cacheKey, [ $value ], "geocode"); |
|
| 103 | 103 | |
| 104 | 104 | return $this; |
| 105 | 105 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | public function geocodeQuery(GeocodeQuery $query) : self |
| 108 | 108 | { |
| 109 | 109 | $cacheKey = serialize($query); |
| 110 | - $this->results = $this->cacheRequest($cacheKey, [$query], "geocodeQuery"); |
|
| 110 | + $this->results = $this->cacheRequest($cacheKey, [ $query ], "geocodeQuery"); |
|
| 111 | 111 | |
| 112 | 112 | return $this; |
| 113 | 113 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | return $this; |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - public function registerProviders(array $providers = []) : self |
|
| 156 | + public function registerProviders(array $providers = [ ]) : self |
|
| 157 | 157 | { |
| 158 | 158 | $this->aggregator->registerProviders($providers); |
| 159 | 159 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | public function reverse(float $latitude, float $longitude) : self |
| 171 | 171 | { |
| 172 | 172 | $cacheKey = (new Str)->slug(strtolower(urlencode("{$latitude}-{$longitude}"))); |
| 173 | - $this->results = $this->cacheRequest($cacheKey, [$latitude, $longitude], "reverse"); |
|
| 173 | + $this->results = $this->cacheRequest($cacheKey, [ $latitude, $longitude ], "reverse"); |
|
| 174 | 174 | |
| 175 | 175 | return $this; |
| 176 | 176 | } |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | public function reverseQuery(ReverseQuery $query) : self |
| 179 | 179 | { |
| 180 | 180 | $cacheKey = serialize($query); |
| 181 | - $this->results = $this->cacheRequest($cacheKey, [$query], "reverseQuery"); |
|
| 181 | + $this->results = $this->cacheRequest($cacheKey, [ $query ], "reverseQuery"); |
|
| 182 | 182 | |
| 183 | 183 | return $this; |
| 184 | 184 | } |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | |
| 193 | 193 | protected function cacheRequest(string $cacheKey, array $queryElements, string $queryType) |
| 194 | 194 | { |
| 195 | - if (! $this->isCaching) { |
|
| 195 | + if (!$this->isCaching) { |
|
| 196 | 196 | $this->isCaching = true; |
| 197 | 197 | |
| 198 | 198 | return collect($this->aggregator->{$queryType}(...$queryElements)); |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | |
| 205 | 205 | $result = app("cache") |
| 206 | 206 | ->store($store) |
| 207 | - ->remember($hashedCacheKey, $duration, function () use ($cacheKey, $queryElements, $queryType) { |
|
| 207 | + ->remember($hashedCacheKey, $duration, function() use ($cacheKey, $queryElements, $queryType) { |
|
| 208 | 208 | return [ |
| 209 | 209 | "key" => $cacheKey, |
| 210 | 210 | "value" => collect($this->aggregator->{$queryType}(...$queryElements)), |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | |
| 245 | 245 | if (is_array(config('geocoder.reader'))) { |
| 246 | 246 | $readerClass = array_key_first(config('geocoder.reader')); |
| 247 | - $readerArguments = config('geocoder.reader')[$readerClass]; |
|
| 247 | + $readerArguments = config('geocoder.reader')[ $readerClass ]; |
|
| 248 | 248 | $reflection = new ReflectionClass($readerClass); |
| 249 | 249 | $reader = $reflection->newInstanceArgs($readerArguments); |
| 250 | 250 | } |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | |
| 278 | 278 | protected function getProvidersFromConfiguration(Collection $providers) : array |
| 279 | 279 | { |
| 280 | - $providers = $providers->map(function ($arguments, $provider) { |
|
| 280 | + $providers = $providers->map(function($arguments, $provider) { |
|
| 281 | 281 | if (is_string($arguments) && $arguments === ResolveFromContainer::class) { |
| 282 | 282 | return app($provider); |
| 283 | 283 | } |
@@ -311,8 +311,8 @@ discard block |
||
| 311 | 311 | array $queryElements, |
| 312 | 312 | string $queryType |
| 313 | 313 | ) { |
| 314 | - if ($result["key"] === $cacheKey) { |
|
| 315 | - return $result["value"]; |
|
| 314 | + if ($result[ "key" ] === $cacheKey) { |
|
| 315 | + return $result[ "value" ]; |
|
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | app("cache") |