SpotifyCredentialService
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- getAccessToken() : string|null
- Get the access token for a user
- getRefreshToken() : string|null
- Get the refresh token for a user
- hasValidCredentials() : bool
- Check if user has valid Spotify credentials
- isTokenExpired() : bool
- Check if access token is expired
- removeCredentials() : void
- Remove Spotify credentials for a user
- storeCredentials() : void
- Store Spotify credentials for a user
Properties
$thirdPartyCredentialService read-only
private
ThirdPartyCredentialService
$thirdPartyCredentialService
Methods
__construct()
public
__construct(ThirdPartyCredentialService $thirdPartyCredentialService) : mixed
Parameters
- $thirdPartyCredentialService : ThirdPartyCredentialService
getAccessToken()
Get the access token for a user
public
getAccessToken(User $user) : string|null
Parameters
- $user : User
Return values
string|nullgetRefreshToken()
Get the refresh token for a user
public
getRefreshToken(User $user) : string|null
Parameters
- $user : User
Return values
string|nullhasValidCredentials()
Check if user has valid Spotify credentials
public
hasValidCredentials(User $user) : bool
Parameters
- $user : User
Return values
boolisTokenExpired()
Check if access token is expired
public
isTokenExpired(User $user) : bool
Parameters
- $user : User
Return values
boolremoveCredentials()
Remove Spotify credentials for a user
public
removeCredentials(User $user) : void
Parameters
- $user : User
storeCredentials()
Store Spotify credentials for a user
public
storeCredentials(User $user, string $accessToken, string $refreshToken[, int|null $expiresIn = null ]) : void
Parameters
- $user : User
- $accessToken : string
- $refreshToken : string
- $expiresIn : int|null = null