@@ -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 |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $dumper = new $dumperClass; |
83 | 83 | $results = collect($this->results->all()); |
84 | 84 | |
85 | - return $results->map(function ($result) use ($dumper) { |
|
85 | + return $results->map(function($result) use ($dumper) { |
|
86 | 86 | return $dumper->dump($result); |
87 | 87 | }); |
88 | 88 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | public function geocode(string $value) : self |
91 | 91 | { |
92 | 92 | $cacheKey = (new Str)->slug(strtolower(urlencode($value))); |
93 | - $this->results = $this->cacheRequest($cacheKey, [$value], "geocode"); |
|
93 | + $this->results = $this->cacheRequest($cacheKey, [ $value ], "geocode"); |
|
94 | 94 | |
95 | 95 | return $this; |
96 | 96 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | public function geocodeQuery(GeocodeQuery $query) : self |
99 | 99 | { |
100 | 100 | $cacheKey = serialize($query); |
101 | - $this->results = $this->cacheRequest($cacheKey, [$query], "geocodeQuery"); |
|
101 | + $this->results = $this->cacheRequest($cacheKey, [ $query ], "geocodeQuery"); |
|
102 | 102 | |
103 | 103 | return $this; |
104 | 104 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | return $this; |
143 | 143 | } |
144 | 144 | |
145 | - public function registerProviders(array $providers = []) : self |
|
145 | + public function registerProviders(array $providers = [ ]) : self |
|
146 | 146 | { |
147 | 147 | $this->aggregator->registerProviders($providers); |
148 | 148 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | public function reverse(float $latitude, float $longitude) : self |
160 | 160 | { |
161 | 161 | $cacheKey = (new Str)->slug(strtolower(urlencode("{$latitude}-{$longitude}"))); |
162 | - $this->results = $this->cacheRequest($cacheKey, [$latitude, $longitude], "reverse"); |
|
162 | + $this->results = $this->cacheRequest($cacheKey, [ $latitude, $longitude ], "reverse"); |
|
163 | 163 | |
164 | 164 | return $this; |
165 | 165 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | public function reverseQuery(ReverseQuery $query) : self |
168 | 168 | { |
169 | 169 | $cacheKey = serialize($query); |
170 | - $this->results = $this->cacheRequest($cacheKey, [$query], "reverseQuery"); |
|
170 | + $this->results = $this->cacheRequest($cacheKey, [ $query ], "reverseQuery"); |
|
171 | 171 | |
172 | 172 | return $this; |
173 | 173 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | |
188 | 188 | $result = app("cache") |
189 | 189 | ->store($store) |
190 | - ->remember($hashedCacheKey, $duration, function () use ($cacheKey, $queryElements, $queryType) { |
|
190 | + ->remember($hashedCacheKey, $duration, function() use ($cacheKey, $queryElements, $queryType) { |
|
191 | 191 | return [ |
192 | 192 | "key" => $cacheKey, |
193 | 193 | "value" => collect($this->aggregator->{$queryType}(...$queryElements)), |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | |
228 | 228 | if (is_array(config('geocoder.reader'))) { |
229 | 229 | $readerClass = array_key_first(config('geocoder.reader')); |
230 | - $readerArguments = config('geocoder.reader')[$readerClass]; |
|
230 | + $readerArguments = config('geocoder.reader')[ $readerClass ]; |
|
231 | 231 | $reflection = new ReflectionClass($readerClass); |
232 | 232 | $reader = $reflection->newInstanceArgs($readerArguments); |
233 | 233 | } |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | |
261 | 261 | protected function getProvidersFromConfiguration(Collection $providers) : array |
262 | 262 | { |
263 | - $providers = $providers->map(function ($arguments, $provider) { |
|
263 | + $providers = $providers->map(function($arguments, $provider) { |
|
264 | 264 | $arguments = $this->getArguments($arguments, $provider); |
265 | 265 | $reflection = new ReflectionClass($provider); |
266 | 266 | |
@@ -290,8 +290,8 @@ discard block |
||
290 | 290 | array $queryElements, |
291 | 291 | string $queryType |
292 | 292 | ) { |
293 | - if ($result["key"] === $cacheKey) { |
|
294 | - return $result["value"]; |
|
293 | + if ($result[ "key" ] === $cacheKey) { |
|
294 | + return $result[ "value" ]; |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | app("cache") |
@@ -61,7 +61,7 @@ |
||
61 | 61 | env('GOOGLE_MAPS_LOCALE', 'us'), |
62 | 62 | env('GOOGLE_MAPS_API_KEY'), |
63 | 63 | ], |
64 | - GeoPlugin::class => [], |
|
64 | + GeoPlugin::class => [ ], |
|
65 | 65 | ], |
66 | 66 | ], |
67 | 67 |