Completed
Push — master ( de6047...007358 )
by Mike
17s
created
src/ProviderAndDumperAggregator.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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")
Please login to merge, or discard this patch.