Completed
Push — master ( 0c7e3d...41f22b )
by Mike
21:24 queued 12s
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
     }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
         return $this;
151 151
     }
152 152
 
153
-    public function registerProviders(array $providers = []) : self
153
+    public function registerProviders(array $providers = [ ]) : self
154 154
     {
155 155
         $this->aggregator->registerProviders($providers);
156 156
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     public function reverse(float $latitude, float $longitude) : self
168 168
     {
169 169
         $cacheKey = (new Str)->slug(strtolower(urlencode("{$latitude}-{$longitude}")));
170
-        $this->results = $this->cacheRequest($cacheKey, [$latitude, $longitude], "reverse");
170
+        $this->results = $this->cacheRequest($cacheKey, [ $latitude, $longitude ], "reverse");
171 171
 
172 172
         return $this;
173 173
     }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
     public function reverseQuery(ReverseQuery $query) : self
176 176
     {
177 177
         $cacheKey = serialize($query);
178
-        $this->results = $this->cacheRequest($cacheKey, [$query], "reverseQuery");
178
+        $this->results = $this->cacheRequest($cacheKey, [ $query ], "reverseQuery");
179 179
 
180 180
         return $this;
181 181
     }
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
     protected function cacheRequest(string $cacheKey, array $queryElements, string $queryType)
191 191
     {
192
-        if (! $this->isCaching) {
192
+        if (!$this->isCaching) {
193 193
             return collect($this->aggregator->{$queryType}(...$queryElements));
194 194
         }
195 195
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 
200 200
         $result = app("cache")
201 201
             ->store($store)
202
-            ->remember($hashedCacheKey, $duration, function () use ($cacheKey, $queryElements, $queryType) {
202
+            ->remember($hashedCacheKey, $duration, function() use ($cacheKey, $queryElements, $queryType) {
203 203
                 return [
204 204
                     "key" => $cacheKey,
205 205
                     "value" => collect($this->aggregator->{$queryType}(...$queryElements)),
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
         if (is_array(config('geocoder.reader'))) {
241 241
             $readerClass = array_key_first(config('geocoder.reader'));
242
-            $readerArguments = config('geocoder.reader')[$readerClass];
242
+            $readerArguments = config('geocoder.reader')[ $readerClass ];
243 243
             $reflection = new ReflectionClass($readerClass);
244 244
             $reader = $reflection->newInstanceArgs($readerArguments);
245 245
         }
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
     protected function getProvidersFromConfiguration(Collection $providers) : array
274 274
     {
275
-        $providers = $providers->map(function ($arguments, $provider) {
275
+        $providers = $providers->map(function($arguments, $provider) {
276 276
             $arguments = $this->getArguments($arguments, $provider);
277 277
             $reflection = new ReflectionClass($provider);
278 278
 
@@ -302,8 +302,8 @@  discard block
 block discarded – undo
302 302
         array $queryElements,
303 303
         string $queryType
304 304
     ) {
305
-        if ($result["key"] === $cacheKey) {
306
-            return $result["value"];
305
+        if ($result[ "key" ] === $cacheKey) {
306
+            return $result[ "value" ];
307 307
         }
308 308
 
309 309
         app("cache")
Please login to merge, or discard this patch.