BaseHandler
in package
AbstractYes
Table of Contents
Properties
- $accessToken : string|null
- $baseUrl : string
- $client : Client
- $credentialService : SpotifyCredentialService|null
Methods
- __construct() : mixed
- setAccessToken() : void
- Set the access token
- setCredentialService() : void
- Set the credential service
- getAccessToken() : string|null
- Get the current access token
- getAuthHeaders() : array<string|int, mixed>
- Get authorization headers
- makeRequest() : array<string|int, mixed>
- Make an authenticated request
Properties
$accessToken
protected
string|null
$accessToken
= null
$baseUrl read-only
protected
string
$baseUrl
$client read-only
protected
Client
$client
$credentialService
protected
SpotifyCredentialService|null
$credentialService
= null
Methods
__construct()
public
__construct(Client $client, string $baseUrl) : mixed
Parameters
- $client : Client
- $baseUrl : string
setAccessToken()
Set the access token
public
setAccessToken(string|null $accessToken) : void
Parameters
- $accessToken : string|null
setCredentialService()
Set the credential service
public
setCredentialService(SpotifyCredentialService $credentialService) : void
Parameters
- $credentialService : SpotifyCredentialService
getAccessToken()
Get the current access token
protected
getAccessToken() : string|null
Return values
string|nullgetAuthHeaders()
Get authorization headers
protected
getAuthHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>makeRequest()
Make an authenticated request
protected
makeRequest(string $method, string $endpoint[, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
- $method : string
- $endpoint : string
- $options : array<string|int, mixed> = []