LastFmClient
in package
Table of Contents
Constants
- BASE_URL = 'https://ws.audioscrobbler.com/2.0/'
Properties
- $auth : AuthHandler
- $lookup : LookupHandler
- $search : SearchHandler
- $tags : TagHandler
- $user : UserHandler
- $client : Client
- $credentialService : LastFmCredentialService
Methods
- __clone() : mixed
- Clone the handlers when cloning the client
- __construct() : mixed
- clearSession() : void
- Reset session key for all handlers (logout)
- forUser() : static
- Get authenticated client for a specific user
- getBaseUrl() : string
- Get the base URL
- getClient() : Client
- Get the HTTP client
- getCredentialService() : LastFmCredentialService
- Get the credential service
- getSessionKey() : string|null
- Get the current session key from credential service
- hasValidCredentials() : bool
- Check if current user has valid credentials
- isAuthenticated() : bool
- Check if the client is configured for authenticated requests
- setSessionKey() : void
- Override session key for all handlers
- withSessionKey() : static
- Create a clone of this client with a specific session key
- injectCredentialService() : void
- Inject credential service into all handlers that extend BaseHandler
Constants
BASE_URL
public
mixed
BASE_URL
= 'https://ws.audioscrobbler.com/2.0/'
Properties
$auth
public
AuthHandler
$auth
$lookup
public
LookupHandler
$lookup
$search
public
SearchHandler
$search
$tags
public
TagHandler
$tags
$user
public
UserHandler
$user
$client read-only
private
Client
$client
$credentialService read-only
private
LastFmCredentialService
$credentialService
Methods
__clone()
Clone the handlers when cloning the client
public
__clone() : mixed
__construct()
public
__construct(Client $client, LastFmCredentialService $credentialService) : mixed
Parameters
- $client : Client
- $credentialService : LastFmCredentialService
clearSession()
Reset session key 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
staticgetBaseUrl()
Get the base URL
public
getBaseUrl() : string
Return values
stringgetClient()
Get the HTTP client
public
getClient() : Client
Return values
ClientgetCredentialService()
Get the credential service
public
getCredentialService() : LastFmCredentialService
Return values
LastFmCredentialServicegetSessionKey()
Get the current session key from credential service
public
getSessionKey() : string|null
Return values
string|nullhasValidCredentials()
Check if current user has valid credentials
public
hasValidCredentials() : bool
Return values
boolisAuthenticated()
Check if the client is configured for authenticated requests
public
isAuthenticated() : bool
Return values
boolsetSessionKey()
Override session key for all handlers
public
setSessionKey(string|null $sessionKey) : void
Parameters
- $sessionKey : string|null
withSessionKey()
Create a clone of this client with a specific session key
public
withSessionKey(string|null $sessionKey) : static
Parameters
- $sessionKey : string|null
Return values
staticinjectCredentialService()
Inject credential service into all handlers that extend BaseHandler
private
injectCredentialService() : void