@@ -72,7 +72,7 @@ |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
75 | - * @return callable |
|
75 | + * @return \Closure |
|
76 | 76 | */ |
77 | 77 | public static function tap() |
78 | 78 | { |
@@ -23,10 +23,10 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 = []; |
@@ -48,7 +48,7 @@ discard block |
||
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 |
||
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 | /** |
@@ -38,7 +38,7 @@ |
||
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 | } |
@@ -41,7 +41,7 @@ discard block |
||
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 |
||
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 | } |
@@ -43,7 +43,7 @@ discard block |
||
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 |
||
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 | } |
@@ -91,7 +91,7 @@ |
||
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 | } |
@@ -24,7 +24,7 @@ |
||
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 | /** |
@@ -23,7 +23,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function __construct($path) |
25 | 25 | { |
26 | - $this->path = (string)$path . '/certificates'; |
|
26 | + $this->path = (string) $path.'/certificates'; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function load(CertificateType $certificateType) |
33 | 33 | { |
34 | - if (!file_exists($this->path . '/' . $certificateType->toString())) { |
|
34 | + if (!file_exists($this->path.'/'.$certificateType->toString())) { |
|
35 | 35 | throw new CertificateNotFoundException($certificateType, $this->path); |
36 | 36 | } |
37 | 37 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | mkdir($this->path); |
52 | 52 | } |
53 | 53 | |
54 | - file_put_contents($this->path . '/' . $certificateType, $certificate); |
|
54 | + file_put_contents($this->path.'/'.$certificateType, $certificate); |
|
55 | 55 | |
56 | 56 | // save server |
57 | 57 | $this->cache[$certificateType->toString()] = $certificate; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | // load from file system |
75 | - $certificate = file_get_contents($this->path . '/' . $certificateType->toString()); |
|
75 | + $certificate = file_get_contents($this->path.'/'.$certificateType->toString()); |
|
76 | 76 | |
77 | 77 | if (!$certificate) { |
78 | 78 | throw new CertificateNotFoundException($certificateType, $this->path); |