ChainProvider
in package
implements
CredentialProvider, ResetInterface
FinalYes
Chains several CredentialProvider together.
Credentials are fetched from the first CredentialProvider that does not returns null. The CredentialProvider will be memoized and will be directly called the next times.
Tags
Table of Contents
Interfaces
- CredentialProvider
- Interface for providing Credential.
- ResetInterface
- Provides a way to reset an object to its initial state.
Properties
- $lastSuccessfulProvider : array<string, CredentialProvider|null>
- $providers : iterable<string|int, CredentialProvider>
Methods
- __construct() : mixed
- createDefaultChain() : CredentialProvider
- getCredentials() : Credentials|null
- Return a Credential when possible. Return null otherwise.
- reset() : void
Properties
$lastSuccessfulProvider
private
array<string, CredentialProvider|null>
$lastSuccessfulProvider
= []
$providers
private
iterable<string|int, CredentialProvider>
$providers
Methods
__construct()
public
__construct(iterable<string|int, CredentialProvider> $providers) : mixed
Parameters
- $providers : iterable<string|int, CredentialProvider>
createDefaultChain()
public
static createDefaultChain([HttpClientInterface|null $httpClient = null ][, LoggerInterface|null $logger = null ]) : CredentialProvider
Parameters
- $httpClient : HttpClientInterface|null = null
- $logger : LoggerInterface|null = null
Return values
CredentialProvidergetCredentials()
Return a Credential when possible. Return null otherwise.
public
getCredentials(Configuration $configuration) : Credentials|null
Parameters
- $configuration : Configuration
Return values
Credentials|nullreset()
public
reset() : void