Bånder

SpotifyClient
in package

Table of Contents

Constants

BASE_URL  = 'https://api.spotify.com/v1/'

Properties

$auth  : AuthHandler
$genres  : GenreHandler
$search  : SearchHandler
$user  : UserHandler
$client  : Client
$credentialService  : SpotifyCredentialService

Methods

__clone()  : mixed
Clone the handlers when cloning the client
__construct()  : mixed
clearSession()  : void
Reset access token for all handlers (logout)
forUser()  : static
Get authenticated client for a specific user
getAccessToken()  : string|null
Get the current access token from credential service
getBaseUrl()  : string
Get the base URL
getClient()  : Client
Get the HTTP client
getCredentialService()  : SpotifyCredentialService
Get the credential service
hasValidCredentials()  : bool
Check if current user has valid credentials
isAuthenticated()  : bool
Check if the client is configured for authenticated requests
setAccessToken()  : void
Override access token for all handlers
withAccessToken()  : static
Create a clone of this client with a specific access token
injectCredentialService()  : void
Inject credential service into all handlers that extend BaseHandler

Constants

BASE_URL

public mixed BASE_URL = 'https://api.spotify.com/v1/'

Properties

Methods

__clone()

Clone the handlers when cloning the client

public __clone() : mixed

clearSession()

Reset access token for all handlers (logout)

public clearSession() : void

forUser()

Get authenticated client for a specific user

public forUser(User $user) : static
Parameters
$user : User
Return values
static

getAccessToken()

Get the current access token from credential service

public getAccessToken() : string|null
Return values
string|null

getBaseUrl()

Get the base URL

public getBaseUrl() : string
Return values
string

getClient()

Get the HTTP client

public getClient() : Client
Return values
Client

hasValidCredentials()

Check if current user has valid credentials

public hasValidCredentials() : bool
Return values
bool

isAuthenticated()

Check if the client is configured for authenticated requests

public isAuthenticated() : bool
Return values
bool

setAccessToken()

Override access token for all handlers

public setAccessToken(string|null $accessToken) : void
Parameters
$accessToken : string|null

withAccessToken()

Create a clone of this client with a specific access token

public withAccessToken(string|null $accessToken) : static
Parameters
$accessToken : string|null
Return values
static

injectCredentialService()

Inject credential service into all handlers that extend BaseHandler

private injectCredentialService() : void

        
On this page

Search results