Completed
Push — master ( 848733...7881aa )
by Mike
22:08
created
src/ProviderAndDumperAggregator.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,6 @@
 block discarded – undo
18 18
 use Geocoder\Laravel\Exceptions\InvalidDumperException;
19 19
 use Geocoder\ProviderAggregator;
20 20
 use Geocoder\Query\GeocodeQuery;
21
-use Geocoder\Query\Query;
22 21
 use Geocoder\Query\ReverseQuery;
23 22
 use Illuminate\Support\Collection;
24 23
 use ReflectionClass;
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         $dumper = new $dumperClass;
74 74
         $results = collect($this->results->all());
75 75
 
76
-        return $results->map(function ($result) use ($dumper) {
76
+        return $results->map(function($result) use ($dumper) {
77 77
             return $dumper->dump($result);
78 78
         });
79 79
     }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     public function geocode(string $value) : self
82 82
     {
83 83
         $cacheKey = str_slug(strtolower(urlencode($value)));
84
-        $this->results = $this->cacheRequest($cacheKey, [$value], "geocode");
84
+        $this->results = $this->cacheRequest($cacheKey, [ $value ], "geocode");
85 85
 
86 86
         return $this;
87 87
     }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     public function geocodeQuery(GeocodeQuery $query) : self
90 90
     {
91 91
         $cacheKey = serialize($query);
92
-        $this->results = $this->cacheRequest($cacheKey, [$query], "geocodeQuery");
92
+        $this->results = $this->cacheRequest($cacheKey, [ $query ], "geocodeQuery");
93 93
 
94 94
         return $this;
95 95
     }
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         return $this;
134 134
     }
135 135
 
136
-    public function registerProviders(array $providers = []) : self
136
+    public function registerProviders(array $providers = [ ]) : self
137 137
     {
138 138
         $this->aggregator->registerProviders($providers);
139 139
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     public function reverse(float $latitude, float $longitude) : self
151 151
     {
152 152
         $cacheKey = str_slug(strtolower(urlencode("{$latitude}-{$longitude}")));
153
-        $this->results = $this->cacheRequest($cacheKey, [$latitude, $longitude], "reverse");
153
+        $this->results = $this->cacheRequest($cacheKey, [ $latitude, $longitude ], "reverse");
154 154
 
155 155
         return $this;
156 156
     }
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
     public function reverseQuery(ReverseQuery $query) : self
159 159
     {
160 160
         $cacheKey = serialize($query);
161
-        $this->results = $this->cacheRequest($cacheKey, [$query], "reverseQuery");
161
+        $this->results = $this->cacheRequest($cacheKey, [ $query ], "reverseQuery");
162 162
 
163 163
         return $this;
164 164
     }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 
179 179
         $result = app("cache")
180 180
             ->store($store)
181
-            ->remember($hashedCacheKey, $duration, function () use ($cacheKey, $queryElements, $queryType) {
181
+            ->remember($hashedCacheKey, $duration, function() use ($cacheKey, $queryElements, $queryType) {
182 182
                 return [
183 183
                     "key" => $cacheKey,
184 184
                     "value" => collect($this->aggregator->{$queryType}(...$queryElements)),
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 
235 235
     protected function getProvidersFromConfiguration(Collection $providers) : array
236 236
     {
237
-        $providers = $providers->map(function ($arguments, $provider) {
237
+        $providers = $providers->map(function($arguments, $provider) {
238 238
             $arguments = $this->getArguments($arguments, $provider);
239 239
             $reflection = new ReflectionClass($provider);
240 240
 
@@ -255,8 +255,8 @@  discard block
 block discarded – undo
255 255
         array $queryElements,
256 256
         string $queryType
257 257
     ) {
258
-        if ($result["key"] === $cacheKey) {
259
-            return $result["value"];
258
+        if ($result[ "key" ] === $cacheKey) {
259
+            return $result[ "value" ];
260 260
         }
261 261
 
262 262
         app("cache")
Please login to merge, or discard this patch.