Container
interface Container (View source)
Methods
Determine if the given abstract type has been bound.
Alias a type to a different name.
Assign a set of tags to a given binding.
Resolve all of the bindings for a given tag.
Register an existing instance as shared in the container.
Define a contextual binding.
Resolve the given type from the container.
Call the given Closure / class@method and inject its dependencies.
Determine if the given abstract type has been resolved.
Register a new after resolving callback.
Details
at line line 33
void
tag(
array|string $abstracts,
array|mixed $tags)
Assign a set of tags to a given binding.
at line line 51
void
bind(
string|array $abstract,
Closure|string|null $concrete = null,
bool $shared = false)
Register a binding with the container.
at line line 61
void
bindIf(
string $abstract,
Closure|string|null $concrete = null,
bool $shared = false)
Register a binding if it hasn't already been registered.
at line line 70
void
singleton(
string|array $abstract,
Closure|string|null $concrete = null)
Register a shared binding in the container.
at line line 81
void
extend(
string $abstract,
Closure $closure)
"Extend" an abstract type in the container.
at line line 90
void
instance(
string $abstract,
mixed $instance)
Register an existing instance as shared in the container.
at line line 107
mixed
make(
string $abstract,
array $parameters = array())
Resolve the given type from the container.
at line line 117
mixed
call(
callable|string $callback,
array $parameters = array(),
string|null $defaultMethod = null)
Call the given Closure / class@method and inject its dependencies.
at line line 125
bool
resolved(
string $abstract)
Determine if the given abstract type has been resolved.