class ContextualBindingBuilder implements ContextualBindingBuilder

Properties

protected string $needs

The abstract target.

Methods

__construct(Container $container, string|array $concrete)

Create a new contextual binding builder.

needs(string $abstract)

Define the abstract target that depends on the context.

give(mixed $implementation)

Define the implementation for the contextual binding.

giveTagged(string $tag)

Define tagged services to be used as the implementation for the contextual binding.

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

Specify the configuration item to bind as a primitive.

Details

at line 20
__construct(Container $container, string|array $concrete)

Create a new contextual binding builder.

Parameters

Container $container
string|array $concrete

at line 29
ContextualBindingBuilder needs(string $abstract)

Define the abstract target that depends on the context.

Parameters

string $abstract

Return Value

ContextualBindingBuilder

at line 39
ContextualBindingBuilder give(mixed $implementation)

Define the implementation for the contextual binding.

Parameters

mixed $implementation

Return Value

ContextualBindingBuilder

at line 51
ContextualBindingBuilder giveTagged(string $tag)

Define tagged services to be used as the implementation for the contextual binding.

Parameters

string $tag

Return Value

ContextualBindingBuilder

at line 63
ContextualBindingBuilder giveConfig(string $key, mixed $default = null)

Specify the configuration item to bind as a primitive.

Parameters

string $key
mixed $default

Return Value

ContextualBindingBuilder