Passed
Push — master ( c10e53...f27ac7 )
by Einar-Johan
02:18
created
src/DNBRequestHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 
32 32
     public function __invoke(callable $handler)
33 33
     {
34
-        return function (RequestInterface $request, array $options) use ($handler) {
34
+        return function(RequestInterface $request, array $options) use ($handler) {
35 35
             return $handler(
36 36
                 $this->signer->signRequest(
37 37
                     $request->withAddedHeader('Accept', 'application/json')
Please login to merge, or discard this patch.
src/Client.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
         $this->customerId = $customerId;
19 19
         $this->client = new GuzzleClient([
20 20
             'base_uri' => config('services.dnb.endpoint'),
21
-            'handler' => tap(HandlerStack::create(new CurlHandler()), function ($stack) {
21
+            'handler' => tap(HandlerStack::create(new CurlHandler()), function($stack) {
22 22
                 $stack->push(new DNBRequestHandler(
23 23
                     new Credentials(
24 24
                         config('services.dnb.client_id'),
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         ]);
32 32
     }
33 33
 
34
-    public function fetch($endpoint, $method = 'GET', $params = [])
34
+    public function fetch($endpoint, $method = 'GET', $params = [ ])
35 35
     {
36 36
         return json_decode(
37 37
             $this->client
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
         if (is_array($location)) {
153 153
             return $this->fetch('/locations/branches/coordinates', 'GET', [
154 154
                 'query' => [
155
-                    'latitude'  => $location[0],
156
-                    'longitude'    => $location[1]
155
+                    'latitude'  => $location[ 0 ],
156
+                    'longitude'    => $location[ 1 ]
157 157
                 ]
158 158
             ]);
159 159
         }
Please login to merge, or discard this patch.
src/JwtToken.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
             config('services.dnb.region') ?? 'eu-west-1'
32 32
         );
33 33
 
34
-        $this->cache_key = 'services.dnb.token.'.$this->customerId;
34
+        $this->cache_key = 'services.dnb.token.' . $this->customerId;
35 35
         $this->token = null;
36 36
     }
37 37
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     public function getFreshToken($cache = true)
55 55
     {
56 56
         $signedrequest = $this->signer->signRequest(
57
-            new Request('GET', config('services.dnb.endpoint').'/token?customerId='.json_encode([
57
+            new Request('GET', config('services.dnb.endpoint') . '/token?customerId=' . json_encode([
58 58
                     'type' => 'SSN',
59 59
                     'value' => $this->customerId
60 60
                 ]), [
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         );
68 68
         $response = (new Client)->send($signedrequest);
69 69
 
70
-        return tap(collect(json_decode($response->getBody())->tokenInfo)->first(), function ($token) use ($cache) {
70
+        return tap(collect(json_decode($response->getBody())->tokenInfo)->first(), function($token) use ($cache) {
71 71
             if ($cache) {
72 72
                 Cache::put($this->cache_key, $token, $this->duration);
73 73
             }
Please login to merge, or discard this patch.