@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | protected function getAuthUrl(): string |
24 | 24 | { |
25 | - return $this->buildAuthUrlFromBase($this->baseUrl . '/platform/oauth/connect/'); |
|
25 | + return $this->buildAuthUrlFromBase($this->baseUrl.'/platform/oauth/connect/'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | #[ArrayShape([ |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | protected function getTokenUrl(): string |
45 | 45 | { |
46 | - return $this->baseUrl . '/oauth/access_token/'; |
|
46 | + return $this->baseUrl.'/oauth/access_token/'; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | protected function getUserByToken(string $token): array |
93 | 93 | { |
94 | - $userUrl = $this->baseUrl . '/oauth/userinfo/'; |
|
94 | + $userUrl = $this->baseUrl.'/oauth/userinfo/'; |
|
95 | 95 | |
96 | 96 | if (empty($this->openId)) { |
97 | 97 | throw new Exceptions\InvalidArgumentException('please set the `open_id` before issue the API request.'); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | protected function getUser(string $token, string $code): array |
88 | 88 | { |
89 | 89 | $responseInstance = $this->getHttpClient()->get( |
90 | - $this->baseUrl . '/cgi-bin/user/getuserinfo', |
|
90 | + $this->baseUrl.'/cgi-bin/user/getuserinfo', |
|
91 | 91 | [ |
92 | 92 | 'query' => \array_filter( |
93 | 93 | [ |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | protected function getUserById(string $userId): array |
116 | 116 | { |
117 | - $responseInstance = $this->getHttpClient()->post($this->baseUrl . '/cgi-bin/user/get', [ |
|
117 | + $responseInstance = $this->getHttpClient()->post($this->baseUrl.'/cgi-bin/user/get', [ |
|
118 | 118 | 'query' => [ |
119 | 119 | Contracts\RFC6749_ABNF_ACCESS_TOKEN => $this->getApiAccessToken(), |
120 | 120 | 'userid' => $userId, |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | protected function requestApiAccessToken(): string |
150 | 150 | { |
151 | - $responseInstance = $this->getHttpClient()->get($this->baseUrl . '/cgi-bin/gettoken', [ |
|
151 | + $responseInstance = $this->getHttpClient()->get($this->baseUrl.'/cgi-bin/gettoken', [ |
|
152 | 152 | 'query' => \array_filter( |
153 | 153 | [ |
154 | 154 | 'corpid' => $this->config->get('corp_id') |
@@ -62,7 +62,7 @@ |
||
62 | 62 | $response = $this->getHttpClient()->get('https://api.figma.com/v1/me', [ |
63 | 63 | 'headers' => [ |
64 | 64 | 'Accept' => 'application/json', |
65 | - 'Authorization' => 'Bearer ' . $token, |
|
65 | + 'Authorization' => 'Bearer '.$token, |
|
66 | 66 | ], |
67 | 67 | ]); |
68 | 68 |
@@ -16,17 +16,17 @@ discard block |
||
16 | 16 | |
17 | 17 | protected function getAuthUrl(): string |
18 | 18 | { |
19 | - return $this->buildAuthUrlFromBase($this->getBaseUrl() . '/oauth2/v2.0/authorize'); |
|
19 | + return $this->buildAuthUrlFromBase($this->getBaseUrl().'/oauth2/v2.0/authorize'); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | protected function getBaseUrl(): string |
23 | 23 | { |
24 | - return 'https://login.microsoftonline.com/' . $this->config['tenant']; |
|
24 | + return 'https://login.microsoftonline.com/'.$this->config['tenant']; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | protected function getTokenUrl(): string |
28 | 28 | { |
29 | - return $this->getBaseUrl() . '/oauth2/v2.0/token'; |
|
29 | + return $this->getBaseUrl().'/oauth2/v2.0/token'; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | protected function getUserByToken(string $token, ?array $query = []): array |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | 'https://graph.microsoft.com/v1.0/me', |
36 | 36 | ['headers' => [ |
37 | 37 | 'Accept' => 'application/json', |
38 | - 'Authorization' => 'Bearer ' . $token, |
|
38 | + 'Authorization' => 'Bearer '.$token, |
|
39 | 39 | ], |
40 | 40 | ] |
41 | 41 | ); |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | |
21 | 21 | protected function getAuthUrl(): string |
22 | 22 | { |
23 | - return $this->buildAuthUrlFromBase($this->baseUrl . '/oauth2/authorize'); |
|
23 | + return $this->buildAuthUrlFromBase($this->baseUrl.'/oauth2/authorize'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | protected function getTokenUrl(): string |
27 | 27 | { |
28 | - return $this->baseUrl . '/2/oauth2/access_token'; |
|
28 | + return $this->baseUrl.'/2/oauth2/access_token'; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | #[ArrayShape([ |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | throw new Exceptions\InvalidTokenException('Invalid token.', $token); |
54 | 54 | } |
55 | 55 | |
56 | - $response = $this->getHttpClient()->get($this->baseUrl . '/2/users/show.json', [ |
|
56 | + $response = $this->getHttpClient()->get($this->baseUrl.'/2/users/show.json', [ |
|
57 | 57 | 'query' => [ |
58 | 58 | 'uid' => $uid, |
59 | 59 | Contracts\RFC6749_ABNF_ACCESS_TOKEN => $token, |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | protected function getTokenPayload(string $token): array |
73 | 73 | { |
74 | - $response = $this->getHttpClient()->post($this->baseUrl . '/oauth2/get_token_info', [ |
|
74 | + $response = $this->getHttpClient()->post($this->baseUrl.'/oauth2/get_token_info', [ |
|
75 | 75 | 'query' => [ |
76 | 76 | Contracts\RFC6749_ABNF_ACCESS_TOKEN => $token, |
77 | 77 | ], |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $response = $this->fromJsonBody($responseInstance); |
67 | 67 | |
68 | 68 | if (!empty($response['error_response'] ?? null) || empty($response['alipay_user_info_share_response'] ?? [])) { |
69 | - throw new Exceptions\BadRequestException((string) $responseInstance->getBody()); |
|
69 | + throw new Exceptions\BadRequestException((string)$responseInstance->getBody()); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | return $response['alipay_user_info_share_response'] ?? []; |
@@ -187,8 +187,8 @@ discard block |
||
187 | 187 | throw new Exceptions\InvalidArgumentException('no RSA private key set.'); |
188 | 188 | } |
189 | 189 | |
190 | - $key = "-----BEGIN RSA PRIVATE KEY-----\n" . |
|
191 | - \chunk_split($key, 64, "\n") . |
|
190 | + $key = "-----BEGIN RSA PRIVATE KEY-----\n". |
|
191 | + \chunk_split($key, 64, "\n"). |
|
192 | 192 | "-----END RSA PRIVATE KEY-----"; |
193 | 193 | |
194 | 194 | \openssl_sign($signContent, $signValue, $key, \OPENSSL_ALGO_SHA256); |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | if (\in_array($k, $except)) { |
204 | 204 | continue; |
205 | 205 | } |
206 | - $param_str .= $k . '='; |
|
206 | + $param_str .= $k.'='; |
|
207 | 207 | $param_str .= $urlencode ? \rawurlencode($v) : $v; |
208 | 208 | $param_str .= '&'; |
209 | 209 | } |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | |
21 | 21 | protected function getAuthUrl(): string |
22 | 22 | { |
23 | - return $this->buildAuthUrlFromBase($this->baseUrl . '/oauth2.0/authorize'); |
|
23 | + return $this->buildAuthUrlFromBase($this->baseUrl.'/oauth2.0/authorize'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | protected function getTokenUrl(): string |
27 | 27 | { |
28 | - return $this->baseUrl . '/oauth2.0/token'; |
|
28 | + return $this->baseUrl.'/oauth2.0/token'; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | #[ArrayShape([ |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | 'query' => $this->getTokenFields($code), |
47 | 47 | ]); |
48 | 48 | |
49 | - \parse_str((string) $response->getBody(), $token); |
|
49 | + \parse_str((string)$response->getBody(), $token); |
|
50 | 50 | |
51 | 51 | return $this->normalizeAccessTokenResponse($token); |
52 | 52 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | protected function getUserByToken(string $token): array |
62 | 62 | { |
63 | - $response = $this->getHttpClient()->get($this->baseUrl . '/oauth2.0/me', [ |
|
63 | + $response = $this->getHttpClient()->get($this->baseUrl.'/oauth2.0/me', [ |
|
64 | 64 | 'query' => [ |
65 | 65 | Contracts\RFC6749_ABNF_ACCESS_TOKEN => $token, |
66 | 66 | 'fmt' => 'json', |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | $me = $this->fromJsonBody($response); |
71 | 71 | |
72 | - $response = $this->getHttpClient()->get($this->baseUrl . '/user/get_user_info', [ |
|
72 | + $response = $this->getHttpClient()->get($this->baseUrl.'/user/get_user_info', [ |
|
73 | 73 | 'query' => [ |
74 | 74 | Contracts\RFC6749_ABNF_ACCESS_TOKEN => $token, |
75 | 75 | 'fmt' => 'json', |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | { |
23 | 23 | $this->state = $this->state ?: \md5(\uniqid(Contracts\RFC6749_ABNF_STATE, true)); |
24 | 24 | |
25 | - return $this->buildAuthUrlFromBase('https://access.line.me/oauth2/' . $this->version . '/authorize'); |
|
25 | + return $this->buildAuthUrlFromBase('https://access.line.me/oauth2/'.$this->version.'/authorize'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | protected function getTokenUrl(): string |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | [ |
50 | 50 | 'headers' => [ |
51 | 51 | 'Accept' => 'application/json', |
52 | - 'Authorization' => 'Bearer ' . $token, |
|
52 | + 'Authorization' => 'Bearer '.$token, |
|
53 | 53 | ], |
54 | 54 | ] |
55 | 55 | ); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | return $response['Response'] ?? []; |
133 | 133 | } |
134 | 134 | |
135 | - protected function sign(string $requestMethod, string $host, array $query, string $payload, array $headers, string $credential, ?string $secretKey = null): bool|string |
|
135 | + protected function sign(string $requestMethod, string $host, array $query, string $payload, array $headers, string $credential, ?string $secretKey = null): bool | string |
|
136 | 136 | { |
137 | 137 | $canonicalRequestString = \join( |
138 | 138 | "\n", |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | |
176 | 176 | if (empty($body['UserOpenId'] ?? null)) { |
177 | - throw new Exceptions\AuthorizeFailedException('Authorize Failed: ' . \json_encode($body, JSON_UNESCAPED_UNICODE), $body); |
|
177 | + throw new Exceptions\AuthorizeFailedException('Authorize Failed: '.\json_encode($body, JSON_UNESCAPED_UNICODE), $body); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | $this->openId = $body['UserOpenId'] ?? null; |