From 64692819dd834e9016fb161e1a46075c131eed23 Mon Sep 17 00:00:00 2001 From: Oliver Kaufmann <4414498+okaufmann@users.noreply.github.com> Date: Tue, 23 Jan 2024 09:51:43 +0100 Subject: [PATCH] [5.x] fix: remove typehint to be compatible with Socialite AbstractProvider (#330) --- src/Concerns/RefreshesOAuth2Tokens.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Concerns/RefreshesOAuth2Tokens.php b/src/Concerns/RefreshesOAuth2Tokens.php index 0c9c631b..3ac66749 100644 --- a/src/Concerns/RefreshesOAuth2Tokens.php +++ b/src/Concerns/RefreshesOAuth2Tokens.php @@ -19,8 +19,12 @@ trait RefreshesOAuth2Tokens * * @throws GuzzleException */ - public function refreshToken(ConnectedAccount $connectedAccount): RefreshedCredentials + public function refreshToken($connectedAccount): RefreshedCredentials { + if(!$connectedAccount instanceof ConnectedAccount) { + throw new \RuntimeException('Given parameter must be of type ConnectedAccount.'); + } + if (is_null($connectedAccount->refresh_token)) { throw new \RuntimeException('A valid refresh token is required.'); }