abstract class AbstractProvider

Traits

Properties

static protected int $nextContextNamespace

The next provider context namespace.

from  HasProviderContext
protected string|null $contextNamespace

The unique context namespace for this provider instance.

from  HasProviderContext
protected array $parameters

The custom parameters to be sent with the request.

protected bool $stateless

Indicates if the session state should be utilized.

protected array $additionalConfig

The provider's baseline configuration.

Methods

mixed
getContext(string $key, mixed $default = null)

Get a value from the provider context.

mixed
setContext(string $key, mixed $value)

Set a value in the provider context.

mixed
getOrSetContext(string $key, mixed $value)

Get or set a value in the provider context.

void
forgetContext(string $key)

Forget a value from the provider context.

string
getContextKey(string $key)

Get the context key for the provider.

__construct(Request $request, array $guzzle = [])

Create a new provider instance.

withConfig(array $config)

Set the baseline provider configuration.

setConfig(array $config)

Override provider configuration for the current request.

mixed
getConfig(string|null $key = null, mixed $default = null)

Get a value from the provider configuration.

Client
getHttpClient()

Get an instance of the Guzzle HTTP client.

setHttpClient(Client $client)

Set the Guzzle HTTP client instance.

setRequest(Request $request)

Set the request instance.

getRequest()

Get the request instance.

bool
usesState()

Determine if the provider is operating with state.

bool
isStateless()

Determine if the provider is operating as stateless.

stateless()

Indicate that the provider should operate as stateless.

string
getState()

Get the string used for session state.

with(array $parameters)

Set the custom parameters of the request.

array
getParameters()

Get the custom parameters of the request.

Details

in HasProviderContext at line 30
protected mixed getContext(string $key, mixed $default = null)

Get a value from the provider context.

Parameters

string $key
mixed $default

Return Value

mixed

in HasProviderContext at line 38
protected mixed setContext(string $key, mixed $value)

Set a value in the provider context.

Parameters

string $key
mixed $value

Return Value

mixed

in HasProviderContext at line 46
protected mixed getOrSetContext(string $key, mixed $value)

Get or set a value in the provider context.

Parameters

string $key
mixed $value

Return Value

mixed

in HasProviderContext at line 54
protected void forgetContext(string $key)

Forget a value from the provider context.

Parameters

string $key

Return Value

void

in HasProviderContext at line 62
protected string getContextKey(string $key)

Get the context key for the provider.

Parameters

string $key

Return Value

string

at line 41
__construct(Request $request, array $guzzle = [])

Create a new provider instance.

Parameters

Request $request
array $guzzle

at line 52
AbstractProvider withConfig(array $config)

Set the baseline provider configuration.

Boot-only. The configuration persists for the worker lifetime and affects every subsequent request. Use setConfig() for per-request overrides.

Parameters

array $config

Return Value

AbstractProvider

at line 65
AbstractProvider setConfig(array $config)

Override provider configuration for the current request.

The override is isolated to the current coroutine and must be applied independently on the redirect and callback requests.

Parameters

array $config

Return Value

AbstractProvider

at line 77
protected mixed getConfig(string|null $key = null, mixed $default = null)

Get a value from the provider configuration.

Reads per-request context first, falls back to baseline instance property.

Parameters

string|null $key
mixed $default

Return Value

mixed

at line 87
protected Client getHttpClient()

Get an instance of the Guzzle HTTP client.

Return Value

Client

at line 97
AbstractProvider setHttpClient(Client $client)

Set the Guzzle HTTP client instance.

Parameters

Client $client

Return Value

AbstractProvider

at line 110
AbstractProvider setRequest(Request $request)

Set the request instance.

Stores the request in coroutine context so cached providers read the current request without leaking it to concurrent coroutines.

Parameters

Request $request

Return Value

AbstractProvider

at line 120
protected Request getRequest()

Get the request instance.

Return Value

Request

at line 136
protected bool usesState()

Determine if the provider is operating with state.

Return Value

bool

at line 144
protected bool isStateless()

Determine if the provider is operating as stateless.

Return Value

bool

at line 152
AbstractProvider stateless()

Indicate that the provider should operate as stateless.

Return Value

AbstractProvider

at line 162
protected string getState()

Get the string used for session state.

Return Value

string

at line 170
AbstractProvider with(array $parameters)

Set the custom parameters of the request.

Parameters

array $parameters

Return Value

AbstractProvider

at line 180
protected array getParameters()

Get the custom parameters of the request.

Return Value

array