Completed
Push — master ( 393139...42de56 )
by Mitchel
02:18
created
src/Middleware/DebugMiddleware.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
     }
73 73
 
74 74
     /**
75
-     * @return callable
75
+     * @return \Closure
76 76
      */
77 77
     public static function tap()
78 78
     {
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public static function request()
25 25
     {
26
-        return function (RequestInterface $request) {
27
-            echo chr(27) . '[33m' . "REQUEST: " . $request->getMethod() . ' ' . $request->getRequestTarget() . chr(
26
+        return function(RequestInterface $request) {
27
+            echo chr(27).'[33m'."REQUEST: ".$request->getMethod().' '.$request->getRequestTarget().chr(
28 28
                     27
29
-                ) . "[0m\n";
29
+                )."[0m\n";
30 30
 
31 31
             foreach ($request->getHeaders() as $key => $headers) {
32 32
                 foreach ($headers as $header) {
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
                 }
35 35
             }
36 36
 
37
-            $body = (string)$request->getBody();
37
+            $body = (string) $request->getBody();
38 38
             echo $body;
39 39
             $json = @json_decode($body, true);
40 40
             if ($json === null) {
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public static function response()
51 51
     {
52
-        return function (RequestInterface $request, $options, FulfilledPromise $responsePromise) {
52
+        return function(RequestInterface $request, $options, FulfilledPromise $responsePromise) {
53 53
             $responsePromise->then(
54
-                function (ResponseInterface $response) {
55
-                    echo chr(27) . '[33m' . "RESPONSE: HTTP/" . $response->getProtocolVersion() . ' ' . $response->getStatusCode() . ' ' . $response->getReasonPhrase() . chr(27) . "[0m\n";
54
+                function(ResponseInterface $response) {
55
+                    echo chr(27).'[33m'."RESPONSE: HTTP/".$response->getProtocolVersion().' '.$response->getStatusCode().' '.$response->getReasonPhrase().chr(27)."[0m\n";
56 56
 
57 57
                     foreach ($response->getHeaders() as $key => $headers) {
58 58
                         foreach ($headers as $header) {
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                         }
61 61
                     }
62 62
 
63
-                    $body = (string)$response->getBody();
63
+                    $body = (string) $response->getBody();
64 64
                     $json = @json_decode($body, true);
65 65
                     if ($json === null) {
66 66
                         $json = [];
Please login to merge, or discard this patch.
src/Resource/PaymentResource.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function getPayment($userId, $monetaryAccountId, $id)
50 50
     {
51
-        $paymentResponse = $this->client->get($this->getResourceEndpoint($userId, $monetaryAccountId) . '/' . (int)$id);
51
+        $paymentResponse = $this->client->get($this->getResourceEndpoint($userId, $monetaryAccountId).'/'.(int) $id);
52 52
 
53 53
         $payment = $paymentResponse['Response'][0]['Payment'];
54 54
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     private function getResourceEndpoint($userId, $monetaryAccountId)
67 67
     {
68
-        return '/v1/user/' . (int)$userId . '/monetary-account/' . (int)$monetaryAccountId . '/payment';
68
+        return '/v1/user/'.(int) $userId.'/monetary-account/'.(int) $monetaryAccountId.'/payment';
69 69
     }
70 70
 
71 71
     /**
Please login to merge, or discard this patch.
src/Resource/UserResource.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
      */
39 39
     public function getUser($id)
40 40
     {
41
-        $response = $this->client->get($this->getResourceEndpoint() . '/' . (int)$id);
41
+        $response = $this->client->get($this->getResourceEndpoint().'/'.(int) $id);
42 42
 
43 43
         return $response['Response'][0]['UserCompany'];
44 44
     }
Please login to merge, or discard this patch.
src/Resource/CardResource.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function getCard($userId, $cardId)
43 43
     {
44
-        $card = $this->client->get($this->getResourceEndpoint($userId) . '/' . (int)$cardId);
44
+        $card = $this->client->get($this->getResourceEndpoint($userId).'/'.(int) $cardId);
45 45
 
46 46
         return $card['Response'][0];
47 47
     }
@@ -53,6 +53,6 @@  discard block
 block discarded – undo
53 53
      */
54 54
     private function getResourceEndpoint($userId)
55 55
     {
56
-        return '/v1/user/' . (int)$userId . '/card';
56
+        return '/v1/user/'.(int) $userId.'/card';
57 57
     }
58 58
 }
Please login to merge, or discard this patch.
src/Resource/MonetaryAccountResource.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function getMonetaryAccount($userId, $id)
45 45
     {
46
-        $monetaryAccount = $this->client->get($this->getResourceEndpoint($userId) . '/' . (int)$id);
46
+        $monetaryAccount = $this->client->get($this->getResourceEndpoint($userId).'/'.(int) $id);
47 47
 
48 48
         return $monetaryAccount['Response'][0]['MonetaryAccountBank'];
49 49
     }
@@ -53,6 +53,6 @@  discard block
 block discarded – undo
53 53
      */
54 54
     private function getResourceEndpoint($userId)
55 55
     {
56
-        return '/v1/user/' . (int) $userId . '/monetary-account';
56
+        return '/v1/user/'.(int) $userId.'/monetary-account';
57 57
     }
58 58
 }
Please login to merge, or discard this patch.
src/Token/TokenType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
      */
92 92
     private function __construct($type)
93 93
     {
94
-        $this->type = (string)$type;
94
+        $this->type = (string) $type;
95 95
 
96 96
         $this->protect();
97 97
     }
Please login to merge, or discard this patch.
src/Token/DefaultToken.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      */
25 25
     public function __construct($token)
26 26
     {
27
-        $this->token = (string)$token;
27
+        $this->token = (string) $token;
28 28
     }
29 29
 
30 30
     /**
Please login to merge, or discard this patch.
src/Token/Storage/FileTokenStorage.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public function __construct($path)
25 25
     {
26
-        $this->path = (string)$path . '/tokens';
26
+        $this->path = (string) $path.'/tokens';
27 27
     }
28 28
 
29 29
     /**
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public function load(TokenType $type)
33 33
     {
34
-        if (!file_exists($this->path . '/' . $type->toString())) {
34
+        if (!file_exists($this->path.'/'.$type->toString())) {
35 35
             throw new TokenNotFoundException($type, $this->path);
36 36
         }
37 37
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             mkdir($this->path);
52 52
         }
53 53
 
54
-        file_put_contents($this->path . '/' . $type->toString(), $token);
54
+        file_put_contents($this->path.'/'.$type->toString(), $token);
55 55
 
56 56
         $this->cache[$type->toString()] = $token;
57 57
     }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             return $this->cache[$type->toString()];
71 71
         }
72 72
 
73
-        $token = trim(file_get_contents($this->path . '/' . $type->toString()));
73
+        $token = trim(file_get_contents($this->path.'/'.$type->toString()));
74 74
 
75 75
         if (!$token) {
76 76
             throw new TokenNotFoundException($type, $this->path);
Please login to merge, or discard this patch.
src/Client.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public function get($url, array $options = [])
31 31
     {
32
-        return $this->requestAPI('GET', (string)$url, $options);
32
+        return $this->requestAPI('GET', (string) $url, $options);
33 33
     }
34 34
 
35 35
     /**
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function post($url, array $options = [])
42 42
     {
43
-        return $this->requestAPI('POST', (string)$url, $options);
43
+        return $this->requestAPI('POST', (string) $url, $options);
44 44
     }
45 45
 
46 46
     /**
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     private function requestAPI($method, $url, array $options = [])
68 68
     {
69 69
         try {
70
-            $response = $this->httpClient->request((string)$method, $url, $options);
70
+            $response = $this->httpClient->request((string) $method, $url, $options);
71 71
 
72 72
             return json_decode($response->getBody(), true);
73 73
         } catch (ClientException $e) {
Please login to merge, or discard this patch.