@@ -44,7 +44,7 @@ |
||
44 | 44 | env('GOOGLE_MAPS_LOCALE', 'en-US'), |
45 | 45 | env('GOOGLE_MAPS_API_KEY'), |
46 | 46 | ], |
47 | - GeoPlugin::class => [], |
|
47 | + GeoPlugin::class => [ ], |
|
48 | 48 | ], |
49 | 49 | ], |
50 | 50 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | { |
22 | 22 | $configPath = __DIR__ . "/../../config/geocoder.php"; |
23 | 23 | $this->publishes( |
24 | - [$configPath => $this->configPath("geocoder.php")], |
|
24 | + [ $configPath => $this->configPath("geocoder.php") ], |
|
25 | 25 | "config" |
26 | 26 | ); |
27 | 27 | $this->mergeConfigFrom($configPath, "geocoder"); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | public function register() |
31 | 31 | { |
32 | 32 | $this->app->alias("Geocoder", Geocoder::class); |
33 | - $this->app->singleton(ProviderAndDumperAggregator::class, function () { |
|
33 | + $this->app->singleton(ProviderAndDumperAggregator::class, function() { |
|
34 | 34 | return (new ProviderAndDumperAggregator) |
35 | 35 | ->registerProvidersFromConfig(collect(config("geocoder.providers"))); |
36 | 36 | }); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | public function provides() : array |
41 | 41 | { |
42 | - return ["geocoder", ProviderAndDumperAggregator::class]; |
|
42 | + return [ "geocoder", ProviderAndDumperAggregator::class ]; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | protected function configPath(string $path = "") : string |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $dumper = new $dumperClass; |
81 | 81 | $results = collect($this->results->all()); |
82 | 82 | |
83 | - return $results->map(function ($result) use ($dumper) { |
|
83 | + return $results->map(function($result) use ($dumper) { |
|
84 | 84 | return $dumper->dump($result); |
85 | 85 | }); |
86 | 86 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | public function geocode(string $value) : self |
89 | 89 | { |
90 | 90 | $cacheKey = (new Str)->slug(strtolower(urlencode($value))); |
91 | - $this->results = $this->cacheRequest($cacheKey, [$value], "geocode"); |
|
91 | + $this->results = $this->cacheRequest($cacheKey, [ $value ], "geocode"); |
|
92 | 92 | |
93 | 93 | return $this; |
94 | 94 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | public function geocodeQuery(GeocodeQuery $query) : self |
97 | 97 | { |
98 | 98 | $cacheKey = serialize($query); |
99 | - $this->results = $this->cacheRequest($cacheKey, [$query], "geocodeQuery"); |
|
99 | + $this->results = $this->cacheRequest($cacheKey, [ $query ], "geocodeQuery"); |
|
100 | 100 | |
101 | 101 | return $this; |
102 | 102 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | return $this; |
141 | 141 | } |
142 | 142 | |
143 | - public function registerProviders(array $providers = []) : self |
|
143 | + public function registerProviders(array $providers = [ ]) : self |
|
144 | 144 | { |
145 | 145 | $this->aggregator->registerProviders($providers); |
146 | 146 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | public function reverse(float $latitude, float $longitude) : self |
158 | 158 | { |
159 | 159 | $cacheKey = (new Str)->slug(strtolower(urlencode("{$latitude}-{$longitude}"))); |
160 | - $this->results = $this->cacheRequest($cacheKey, [$latitude, $longitude], "reverse"); |
|
160 | + $this->results = $this->cacheRequest($cacheKey, [ $latitude, $longitude ], "reverse"); |
|
161 | 161 | |
162 | 162 | return $this; |
163 | 163 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | public function reverseQuery(ReverseQuery $query) : self |
166 | 166 | { |
167 | 167 | $cacheKey = serialize($query); |
168 | - $this->results = $this->cacheRequest($cacheKey, [$query], "reverseQuery"); |
|
168 | + $this->results = $this->cacheRequest($cacheKey, [ $query ], "reverseQuery"); |
|
169 | 169 | |
170 | 170 | return $this; |
171 | 171 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | |
186 | 186 | $result = app("cache") |
187 | 187 | ->store($store) |
188 | - ->remember($hashedCacheKey, $duration, function () use ($cacheKey, $queryElements, $queryType) { |
|
188 | + ->remember($hashedCacheKey, $duration, function() use ($cacheKey, $queryElements, $queryType) { |
|
189 | 189 | return [ |
190 | 190 | "key" => $cacheKey, |
191 | 191 | "value" => collect($this->aggregator->{$queryType}(...$queryElements)), |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | |
244 | 244 | protected function getProvidersFromConfiguration(Collection $providers) : array |
245 | 245 | { |
246 | - $providers = $providers->map(function ($arguments, $provider) { |
|
246 | + $providers = $providers->map(function($arguments, $provider) { |
|
247 | 247 | $arguments = $this->getArguments($arguments, $provider); |
248 | 248 | $reflection = new ReflectionClass($provider); |
249 | 249 | |
@@ -264,8 +264,8 @@ discard block |
||
264 | 264 | array $queryElements, |
265 | 265 | string $queryType |
266 | 266 | ) { |
267 | - if ($result["key"] === $cacheKey) { |
|
268 | - return $result["value"]; |
|
267 | + if ($result[ "key" ] === $cacheKey) { |
|
268 | + return $result[ "value" ]; |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | app("cache") |