@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | protected function getAuthUrl(): string |
| 18 | 18 | { |
| 19 | - return $this->buildAuthUrlFromBase($this->baseUrl . 'authen/v1/index'); |
|
| 19 | + return $this->buildAuthUrlFromBase($this->baseUrl.'authen/v1/index'); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | protected function getCodeFields(): array |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | protected function getTokenUrl(): string |
| 31 | 31 | { |
| 32 | - return $this->baseUrl . 'authen/v1/access_token'; |
|
| 32 | + return $this->baseUrl.'authen/v1/access_token'; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -81,9 +81,9 @@ discard block |
||
| 81 | 81 | protected function getUserByToken(string $token): array |
| 82 | 82 | { |
| 83 | 83 | $response = $this->getHttpClient()->get( |
| 84 | - $this->baseUrl . '/authen/v1/user_info', |
|
| 84 | + $this->baseUrl.'/authen/v1/user_info', |
|
| 85 | 85 | [ |
| 86 | - 'headers' => ['Content-Type' => 'application/json', 'Authorization' => 'Bearer ' . $token], |
|
| 86 | + 'headers' => ['Content-Type' => 'application/json', 'Authorization' => 'Bearer '.$token], |
|
| 87 | 87 | 'query' => array_filter( |
| 88 | 88 | [ |
| 89 | 89 | 'user_access_token' => $token, |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $response = \json_decode($response->getBody(), true) ?? []; |
| 96 | 96 | |
| 97 | 97 | if (empty($response['data'])) { |
| 98 | - throw new \InvalidArgumentException('You have error! ' . json_encode($response, JSON_UNESCAPED_UNICODE)); |
|
| 98 | + throw new \InvalidArgumentException('You have error! '.json_encode($response, JSON_UNESCAPED_UNICODE)); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | return $response['data']; |
@@ -18,12 +18,12 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | protected function getAuthUrl(): string |
| 20 | 20 | { |
| 21 | - return $this->buildAuthUrlFromBase('https://www.facebook.com/' . $this->version . '/dialog/oauth'); |
|
| 21 | + return $this->buildAuthUrlFromBase('https://www.facebook.com/'.$this->version.'/dialog/oauth'); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | protected function getTokenUrl(): string |
| 25 | 25 | { |
| 26 | - return $this->graphUrl . '/oauth/access_token'; |
|
| 26 | + return $this->graphUrl.'/oauth/access_token'; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | protected function getUserByToken(string $token, ?array $query = []): array |
| 56 | 56 | { |
| 57 | 57 | $appSecretProof = hash_hmac('sha256', $token, $this->getConfig()->get('client_secret')); |
| 58 | - $endpoint = $this->graphUrl . '/' . $this->version . '/me?access_token=' . $token . '&appsecret_proof=' . $appSecretProof . '&fields=' . |
|
| 58 | + $endpoint = $this->graphUrl.'/'.$this->version.'/me?access_token='.$token.'&appsecret_proof='.$appSecretProof.'&fields='. |
|
| 59 | 59 | implode(',', $this->fields); |
| 60 | 60 | |
| 61 | 61 | $response = $this->getHttpClient()->get( |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | protected function mapUserToObject(array $user): User |
| 74 | 74 | { |
| 75 | 75 | $userId = $user['id'] ?? null; |
| 76 | - $avatarUrl = $this->graphUrl . '/' . $this->version . '/' . $userId . '/picture'; |
|
| 76 | + $avatarUrl = $this->graphUrl.'/'.$this->version.'/'.$userId.'/picture'; |
|
| 77 | 77 | |
| 78 | 78 | $firstName = $user['first_name'] ?? null; |
| 79 | 79 | $lastName = $user['last_name'] ?? null; |
@@ -82,10 +82,10 @@ discard block |
||
| 82 | 82 | [ |
| 83 | 83 | 'id' => $user['id'] ?? null, |
| 84 | 84 | 'nickname' => null, |
| 85 | - 'name' => $firstName . ' ' . $lastName, |
|
| 85 | + 'name' => $firstName.' '.$lastName, |
|
| 86 | 86 | 'email' => $user['email'] ?? null, |
| 87 | - 'avatar' => $userId ? $avatarUrl . '?type=normal' : null, |
|
| 88 | - 'avatar_original' => $userId ? $avatarUrl . '?width=1920' : null, |
|
| 87 | + 'avatar' => $userId ? $avatarUrl.'?type=normal' : null, |
|
| 88 | + 'avatar_original' => $userId ? $avatarUrl.'?width=1920' : null, |
|
| 89 | 89 | ] |
| 90 | 90 | ); |
| 91 | 91 | } |
@@ -14,6 +14,6 @@ |
||
| 14 | 14 | { |
| 15 | 15 | parent::__construct($message, -1); |
| 16 | 16 | |
| 17 | - $this->body = (array) $body; |
|
| 17 | + $this->body = (array)$body; |
|
| 18 | 18 | } |
| 19 | 19 | } |