@@ -10,7 +10,7 @@ |
||
10 | 10 | { |
11 | 11 | } |
12 | 12 | |
13 | - public function asRaw(bool $keep_authorization_value = false): int|string|array |
|
13 | + public function asRaw(bool $keep_authorization_value = false): int | string | array |
|
14 | 14 | { |
15 | 15 | // To avoid unintentional logging of credentials the default is to mask the value of the Authorization: header |
16 | 16 | if ($keep_authorization_value) { |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | } |
20 | 20 | |
21 | 21 | $this->api_url = $api_url; |
22 | - if($api_url == Constants::INVOICING_API_URL){ |
|
22 | + if ($api_url == Constants::INVOICING_API_URL) { |
|
23 | 23 | // no idea why, but invoicing requires this header. |
24 | - $additional_headers = array_merge($additional_headers,['Accept: application/vnd.api+json']); |
|
24 | + $additional_headers = array_merge($additional_headers, ['Accept: application/vnd.api+json']); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | 'Accept: application/json', |
42 | 42 | ]; |
43 | 43 | if (!empty($this->auth_string)) { |
44 | - $this->headers[] = 'Authorization: Basic ' . base64_encode($this->auth_string); |
|
44 | + $this->headers[] = 'Authorization: Basic '.base64_encode($this->auth_string); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | // Add custom headers and set headers in cURL object. |
48 | 48 | $this->setHeaders($additional_headers); |
49 | 49 | } |
50 | 50 | |
51 | - function getApiURL(){ |
|
51 | + function getApiURL() { |
|
52 | 52 | return $this->api_url; |
53 | 53 | } |
54 | 54 |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | { |
20 | 20 | if (!empty($query)) { |
21 | 21 | if (strpos($path, '?') === false) { |
22 | - $path .= '?' . http_build_query($query, '', '&'); |
|
22 | + $path .= '?'.http_build_query($query, '', '&'); |
|
23 | 23 | } else { |
24 | - $path .= ini_get('arg_separator.output') . http_build_query($query, '', '&'); |
|
24 | + $path .= ini_get('arg_separator.output').http_build_query($query, '', '&'); |
|
25 | 25 | } |
26 | 26 | } |
27 | 27 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | protected function setUrl(string $url): void |
62 | 62 | { |
63 | - curl_setopt($this->client->ch, CURLOPT_URL, $this->client->getApiURL() . trim($url, '/')); |
|
63 | + curl_setopt($this->client->ch, CURLOPT_URL, $this->client->getApiURL().trim($url, '/')); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | protected function execute(string $request_type, array $form = []): Response |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | // allows for automatic failover on the application layer |
93 | 93 | // as QP is often slow at noticing that they have problems |
94 | 94 | if ($errno === CURLE_OPERATION_TIMEOUTED) { |
95 | - $onTimeout = QuickPay::$onTimeout ?? function () { |
|
95 | + $onTimeout = QuickPay::$onTimeout ?? function() { |
|
96 | 96 | throw new TimeoutException(curl_error($this->client->ch), curl_errno($this->client->ch)); |
97 | 97 | }; |
98 | 98 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | return new Response($response_code, $sent_headers, $received_headers, $response_data); |
116 | 116 | } |
117 | 117 | |
118 | - public function httpBuildQuery(array $query): array|string|null |
|
118 | + public function httpBuildQuery(array $query): array | string | null |
|
119 | 119 | { |
120 | 120 | $query = http_build_query($query, '', '&'); |
121 | 121 |