Completed
Push — master ( 41f22b...2cd881 )
by Mike
21:15
created
src/Providers/GeocoderService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
config/geocoder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
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.