@@ -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 |
@@ -15,7 +15,6 @@ |
||
15 | 15 | use Geocoder\Dumper\Kml; |
16 | 16 | use Geocoder\Dumper\Wkb; |
17 | 17 | use Geocoder\Dumper\Wkt; |
18 | -use Geocoder\Query\Query; |
|
19 | 18 | use Illuminate\Support\Str; |
20 | 19 | use Geocoder\Dumper\GeoJson; |
21 | 20 | use Geocoder\ProviderAggregator; |
@@ -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 = 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 = 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)), |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | |
246 | 246 | protected function getProvidersFromConfiguration(Collection $providers) : array |
247 | 247 | { |
248 | - $providers = $providers->map(function ($arguments, $provider) { |
|
248 | + $providers = $providers->map(function($arguments, $provider) { |
|
249 | 249 | $arguments = $this->getArguments($arguments, $provider); |
250 | 250 | $reflection = new ReflectionClass($provider); |
251 | 251 | |
@@ -266,8 +266,8 @@ discard block |
||
266 | 266 | array $queryElements, |
267 | 267 | string $queryType |
268 | 268 | ) { |
269 | - if ($result["key"] === $cacheKey) { |
|
270 | - return $result["value"]; |
|
269 | + if ($result[ "key" ] === $cacheKey) { |
|
270 | + return $result[ "value" ]; |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | app("cache") |