Methods |
public
|
bound(string $abstract): bool
Determine if the given abstract type has been bound.
Determine if the given abstract type has been bound.
Implemented by
|
#
|
public
|
alias(string $abstract, string $alias): void
Alias a type to a different name.
Alias a type to a different name.
Throws
Implemented by
|
#
|
public
|
tag(array|string $abstracts, array|mixed ...$tags): void
Assign a set of tags to a given binding.
Assign a set of tags to a given binding.
Implemented by
|
#
|
public
|
tagged(string $tag): iterable
Resolve all of the bindings for a given tag.
Resolve all of the bindings for a given tag.
Implemented by
|
#
|
public
|
bind(string $abstract, Closure|string|null $concrete = null, bool $shared = false): void
Register a binding with the container.
Register a binding with the container.
Implemented by
|
#
|
public
|
bindIf(string $abstract, Closure|string|null $concrete = null, bool $shared = false): void
Register a binding if it hasn't already been registered.
Register a binding if it hasn't already been registered.
Implemented by
|
#
|
public
|
singleton(string $abstract, Closure|string|null $concrete = null): void
Register a shared binding in the container.
Register a shared binding in the container.
Implemented by
|
#
|
public
|
singletonIf(string $abstract, Closure|string|null $concrete = null): void
Register a shared binding if it hasn't already been registered.
Register a shared binding if it hasn't already been registered.
Implemented by
|
#
|
public
|
extend(string $abstract, Closure $closure): void
"Extend" an abstract type in the container.
"Extend" an abstract type in the container.
Throws
Implemented by
|
#
|
public
|
instance(string $abstract, mixed $instance): mixed
Register an existing instance as shared in the container.
Register an existing instance as shared in the container.
Implemented by
|
#
|
public
|
addContextualBinding(string $concrete, string $abstract, Closure|string $implementation): void
Add a contextual binding to the container.
Add a contextual binding to the container.
Implemented by
|
#
|
public
|
when(string|array $concrete): ContextualBindingBuilder
Define a contextual binding.
Define a contextual binding.
Implemented by
|
#
|
public
|
factory(string $abstract): Closure
Get a closure to resolve the given type from the container.
Get a closure to resolve the given type from the container.
Implemented by
|
#
|
public
|
flush(): void
Flush the container of all bindings and resolved instances.
Flush the container of all bindings and resolved instances.
Implemented by
|
#
|
public
|
make(string $abstract, array $parameters = []): mixed
Resolve the given type from the container.
Resolve the given type from the container.
Throws
Implemented by
|
#
|
public
|
call(callable|string $callback, array $parameters = [], string|null $defaultMethod = null): mixed
Call the given Closure / class@method and inject its dependencies.
Call the given Closure / class@method and inject its dependencies.
Implemented by
|
#
|
public
|
resolved(string $abstract): bool
Determine if the given abstract type has been resolved.
Determine if the given abstract type has been resolved.
Implemented by
|
#
|
public
|
resolving(Closure|string $abstract, Closure|null $callback = null): void
Register a new resolving callback.
Register a new resolving callback.
Implemented by
|
#
|
public
|
afterResolving(Closure|string $abstract, Closure|null $callback = null): void
Register a new after resolving callback.
Register a new after resolving callback.
Implemented by
|
#
|