diff --git a/src/Provider.php b/src/Provider.php index c6e7e87..78464fd 100644 --- a/src/Provider.php +++ b/src/Provider.php @@ -17,7 +17,9 @@ class Provider extends AbstractProvider implements ProviderInterface */ protected function getAuthUrl($state) { - return $this->buildAuthUrlFromBase('https://accounts.google.com/o/oauth2/auth', $state); + return $this->buildAuthUrlFromBase( + 'https://accounts.google.com/o/oauth2/auth', $state + ); } /** @@ -33,7 +35,8 @@ protected function getTokenUrl() */ protected function getUserByToken($token) { - $response = $this->getHttpClient()->get('https://www.googleapis.com/youtube/v3/channels?part=snippet&mine=true', [ + $response = $this->getHttpClient()->get( + 'https://www.googleapis.com/youtube/v3/channels?part=snippet&mine=true', [ 'headers' => [ 'Authorization' => 'Bearer '.$token, ], @@ -48,11 +51,9 @@ protected function getUserByToken($token) protected function mapUserToObject(array $user) { return (new User())->setRaw($user)->map([ - 'id' => $user['id'], - 'nickname' => $user['snippet']['title'], - 'name' => null, - 'email' => null, - 'avatar' => $user['snippet']['thumbnails']['high']['url'], + 'id' => $user['id'], 'nickname' => $user['snippet']['title'], + 'name' => null, 'email' => null, + 'avatar' => $user['snippet']['thumbnails']['high']['url'], ]); } @@ -61,7 +62,9 @@ protected function mapUserToObject(array $user) */ protected function getTokenFields($code) { - return array_merge(parent::getTokenFields($code), ['grant_type' => 'authorization_code']); + return array_merge(parent::getTokenFields($code), [ + 'grant_type' => 'authorization_code', + ]); } /** diff --git a/src/YouTubeExtendSocialite.php b/src/YouTubeExtendSocialite.php index 5896ae2..bf0fc5f 100644 --- a/src/YouTubeExtendSocialite.php +++ b/src/YouTubeExtendSocialite.php @@ -5,8 +5,13 @@ class YouTubeExtendSocialite { + /** + * Execute the provider. + */ public function handle(SocialiteWasCalled $socialiteWasCalled) { - $socialiteWasCalled->extendSocialite('youtube', __NAMESPACE__.'\Provider'); + $socialiteWasCalled->extendSocialite( + 'youtube', __NAMESPACE__.'\Provider' + ); } }