trait HasProviderContext

Properties

static protected int $nextContextNamespace

The next provider context namespace.

protected string|null $contextNamespace

The unique context namespace for this provider instance.

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.

Details

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

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

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

at line 54
protected void forgetContext(string $key)

Forget a value from the provider context.

Parameters

string $key

Return Value

void

at line 62
protected string getContextKey(string $key)

Get the context key for the provider.

Parameters

string $key

Return Value

string