Completed
Push — master ( 41f22b...2cd881 )
by Mike
21:15
created
src/ProviderAndDumperAggregator.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $dumper = new $dumperClass;
91 91
         $results = collect($this->results->all());
92 92
 
93
-        return $results->map(function ($result) use ($dumper) {
93
+        return $results->map(function($result) use ($dumper) {
94 94
             return $dumper->dump($result);
95 95
         });
96 96
     }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     public function geocode(string $value) : self
99 99
     {
100 100
         $cacheKey = (new Str)->slug(strtolower(urlencode($value)));
101
-        $this->results = $this->cacheRequest($cacheKey, [$value], "geocode");
101
+        $this->results = $this->cacheRequest($cacheKey, [ $value ], "geocode");
102 102
 
103 103
         return $this;
104 104
     }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     public function geocodeQuery(GeocodeQuery $query) : self
107 107
     {
108 108
         $cacheKey = serialize($query);
109
-        $this->results = $this->cacheRequest($cacheKey, [$query], "geocodeQuery");
109
+        $this->results = $this->cacheRequest($cacheKey, [ $query ], "geocodeQuery");
110 110
 
111 111
         return $this;
112 112
     }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         return $this;
153 153
     }
154 154
 
155
-    public function registerProviders(array $providers = []) : self
155
+    public function registerProviders(array $providers = [ ]) : self
156 156
     {
157 157
         $this->aggregator->registerProviders($providers);
158 158
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     public function reverse(float $latitude, float $longitude) : self
170 170
     {
171 171
         $cacheKey = (new Str)->slug(strtolower(urlencode("{$latitude}-{$longitude}")));
172
-        $this->results = $this->cacheRequest($cacheKey, [$latitude, $longitude], "reverse");
172
+        $this->results = $this->cacheRequest($cacheKey, [ $latitude, $longitude ], "reverse");
173 173
 
174 174
         return $this;
175 175
     }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
     public function reverseQuery(ReverseQuery $query) : self
178 178
     {
179 179
         $cacheKey = serialize($query);
180
-        $this->results = $this->cacheRequest($cacheKey, [$query], "reverseQuery");
180
+        $this->results = $this->cacheRequest($cacheKey, [ $query ], "reverseQuery");
181 181
 
182 182
         return $this;
183 183
     }
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
     protected function cacheRequest(string $cacheKey, array $queryElements, string $queryType)
193 193
     {
194
-        if (! $this->isCaching) {
194
+        if (!$this->isCaching) {
195 195
             $this->isCaching = true;
196 196
 
197 197
             return collect($this->aggregator->{$queryType}(...$queryElements));
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 
204 204
         $result = app("cache")
205 205
             ->store($store)
206
-            ->remember($hashedCacheKey, $duration, function () use ($cacheKey, $queryElements, $queryType) {
206
+            ->remember($hashedCacheKey, $duration, function() use ($cacheKey, $queryElements, $queryType) {
207 207
                 return [
208 208
                     "key" => $cacheKey,
209 209
                     "value" => collect($this->aggregator->{$queryType}(...$queryElements)),
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 
244 244
         if (is_array(config('geocoder.reader'))) {
245 245
             $readerClass = array_key_first(config('geocoder.reader'));
246
-            $readerArguments = config('geocoder.reader')[$readerClass];
246
+            $readerArguments = config('geocoder.reader')[ $readerClass ];
247 247
             $reflection = new ReflectionClass($readerClass);
248 248
             $reader = $reflection->newInstanceArgs($readerArguments);
249 249
         }
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 
277 277
     protected function getProvidersFromConfiguration(Collection $providers) : array
278 278
     {
279
-        $providers = $providers->map(function ($arguments, $provider) {
279
+        $providers = $providers->map(function($arguments, $provider) {
280 280
             $arguments = $this->getArguments($arguments, $provider);
281 281
             $reflection = new ReflectionClass($provider);
282 282
 
@@ -306,8 +306,8 @@  discard block
 block discarded – undo
306 306
         array $queryElements,
307 307
         string $queryType
308 308
     ) {
309
-        if ($result["key"] === $cacheKey) {
310
-            return $result["value"];
309
+        if ($result[ "key" ] === $cacheKey) {
310
+            return $result[ "value" ];
311 311
         }
312 312
 
313 313
         app("cache")
Please login to merge, or discard this patch.