Container
interface Container
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.
Details
at line 15
bool
bound(string $abstract)
Determine if the given abstract type has been bound.
at line 24
void
alias(string $abstract, string $alias)
Alias a type to a different name.
at line 33
void
tag(array|string $abstracts, array|mixed $tags)
Assign a set of tags to a given binding.
at line 41
array
tagged(array $tag)
Resolve all of the bindings for a given tag.
at line 51
void
bind(string|array $abstract, Closure|string|null $concrete = null, bool $shared = false)
Register a binding with the container.
at 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 70
void
singleton(string|array $abstract, Closure|string|null $concrete = null)
Register a shared binding in the container.
at line 81
void
extend(string $abstract, Closure $closure)
"Extend" an abstract type in the container.
at line 90
void
instance(string $abstract, mixed $instance)
Register an existing instance as shared in the container.
at line 98
ContextualBindingBuilder
when(string $concrete)
Define a contextual binding.
at line 106
Closure
factory(string $abstract)
Get a closure to resolve the given type from the container.
at line 114
mixed
make(string $abstract)
Resolve the given type from the container.
at line 124
mixed
call(callable|string $callback, array $parameters = [], string|null $defaultMethod = null)
Call the given Closure / class@method and inject its dependencies.
at line 132
bool
resolved(string $abstract)
Determine if the given abstract type has been resolved.
at line 141
void
resolving(string $abstract, Closure $callback = null)
Register a new resolving callback.
at line 150
void
afterResolving(string $abstract, Closure $callback = null)
Register a new after resolving callback.