TagHandler
extends BaseHandler
in package
Table of Contents
Properties
- $baseUrl : string
- $client : Client
- $credentialService : LastFmCredentialService|null
- $sessionKey : string|null
Methods
- __construct() : mixed
- getSimilarTags() : array<string|int, mixed>
- getSimilarTagsAsync() : PromiseInterface
- getTagDataAsync() : PromiseInterface
- Get comprehensive tag data asynchronously
- getTagInfo() : array<string|int, mixed>
- getTagInfoAsync() : PromiseInterface
- getTopAlbums() : array<string|int, mixed>
- getTopAlbumsAsync() : PromiseInterface
- getTopArtists() : array<string|int, mixed>
- getTopArtistsAsync() : PromiseInterface
- getTopTags() : array<string|int, mixed>
- getTopTracks() : array<string|int, mixed>
- getTopTracksAsync() : PromiseInterface
- setCredentialService() : void
- Set the credential service for automatic session management
- setSessionKey() : void
- Manually set session key (overrides automatic detection)
- buildQueryParams() : array<string|int, mixed>
- Build query parameters with automatic session key injection
- getSessionKey() : string|null
- Get session key for authenticated requests
- hasValidCredentials() : bool
- Check if current user has valid credentials
- makeRequest() : array<string|int, mixed>
- Make synchronous API request with error handling
- makeRequestAsync() : PromiseInterface
- Make asynchronous API request returning a promise
- requireAuthentication() : bool
- Require authenticated session for the request
Properties
$baseUrl read-only
protected
string
$baseUrl
$client read-only
protected
Client
$client
$credentialService
protected
LastFmCredentialService|null
$credentialService
= null
$sessionKey
protected
string|null
$sessionKey
= null
Methods
__construct()
public
__construct(Client $client, string $baseUrl) : mixed
Parameters
- $client : Client
- $baseUrl : string
getSimilarTags()
public
getSimilarTags(string $tag) : array<string|int, mixed>
Parameters
- $tag : string
Return values
array<string|int, mixed>getSimilarTagsAsync()
public
getSimilarTagsAsync(string $tag) : PromiseInterface
Parameters
- $tag : string
Return values
PromiseInterfacegetTagDataAsync()
Get comprehensive tag data asynchronously
public
getTagDataAsync(string $tag) : PromiseInterface
Parameters
- $tag : string
Return values
PromiseInterfacegetTagInfo()
public
getTagInfo(string $tag) : array<string|int, mixed>
Parameters
- $tag : string
Return values
array<string|int, mixed>getTagInfoAsync()
public
getTagInfoAsync(string $tag) : PromiseInterface
Parameters
- $tag : string
Return values
PromiseInterfacegetTopAlbums()
public
getTopAlbums(string $tag[, int $limit = 50 ]) : array<string|int, mixed>
Parameters
- $tag : string
- $limit : int = 50
Return values
array<string|int, mixed>getTopAlbumsAsync()
public
getTopAlbumsAsync(string $tag[, int $limit = 50 ]) : PromiseInterface
Parameters
- $tag : string
- $limit : int = 50
Return values
PromiseInterfacegetTopArtists()
public
getTopArtists(string $tag[, int $limit = 50 ]) : array<string|int, mixed>
Parameters
- $tag : string
- $limit : int = 50
Return values
array<string|int, mixed>getTopArtistsAsync()
public
getTopArtistsAsync(string $tag[, int $limit = 50 ]) : PromiseInterface
Parameters
- $tag : string
- $limit : int = 50
Return values
PromiseInterfacegetTopTags()
public
getTopTags([int $limit = 50 ]) : array<string|int, mixed>
Parameters
- $limit : int = 50
Return values
array<string|int, mixed>getTopTracks()
public
getTopTracks(string $tag[, int $limit = 50 ]) : array<string|int, mixed>
Parameters
- $tag : string
- $limit : int = 50
Return values
array<string|int, mixed>getTopTracksAsync()
public
getTopTracksAsync(string $tag[, int $limit = 50 ]) : PromiseInterface
Parameters
- $tag : string
- $limit : int = 50
Return values
PromiseInterfacesetCredentialService()
Set the credential service for automatic session management
public
setCredentialService(LastFmCredentialService $credentialService) : void
Parameters
- $credentialService : LastFmCredentialService
setSessionKey()
Manually set session key (overrides automatic detection)
public
setSessionKey(string|null $sessionKey) : void
Parameters
- $sessionKey : string|null
buildQueryParams()
Build query parameters with automatic session key injection
protected
buildQueryParams(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
Return values
array<string|int, mixed>getSessionKey()
Get session key for authenticated requests
protected
getSessionKey() : string|null
Return values
string|nullhasValidCredentials()
Check if current user has valid credentials
protected
hasValidCredentials() : bool
Return values
boolmakeRequest()
Make synchronous API request with error handling
protected
makeRequest(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
Return values
array<string|int, mixed>makeRequestAsync()
Make asynchronous API request returning a promise
protected
makeRequestAsync(array<string|int, mixed> $params) : PromiseInterface
Parameters
- $params : array<string|int, mixed>
Return values
PromiseInterfacerequireAuthentication()
Require authenticated session for the request
protected
requireAuthentication() : bool