Methods |
public
|
when(array|string $concrete): ContextualBindingBuilder
Define a contextual binding.
Define a contextual binding.
Implements
|
#
|
public
|
bound(string $abstract): bool
Determine if the given abstract type has been bound.
Determine if the given abstract type has been bound.
Implements
|
#
|
public
|
has($id): bool
{@inheritdoc}
Parameters
$id |
Identifier of the entry to look for.
|
Implements
|
#
|
public
|
resolved(string $abstract): bool
Determine if the given abstract type has been resolved.
Determine if the given abstract type has been resolved.
Implements
|
#
|
public
|
isShared(string $abstract): bool
Determine if a given type is shared.
Determine if a given type is shared.
|
#
|
public
|
isAlias(string $name): bool
Determine if a given string is an alias.
Determine if a given string is an alias.
|
#
|
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.
Throws
Implements
|
#
|
public
|
hasMethodBinding(string $method): bool
Determine if the container has a method binding.
Determine if the container has a method binding.
|
#
|
public
|
bindMethod(array|string $method, Closure $callback): void
Bind a callback to resolve with Container::call.
Bind a callback to resolve with Container::call.
|
#
|
public
|
callMethodBinding(string $method, mixed $instance): mixed
Get the method binding for the given method.
Get the method binding for the given method.
|
#
|
public
|
addContextualBinding(string $concrete, string $abstract, Closure|string $implementation): void
Add a contextual binding to the container.
Add a contextual binding to the container.
Implements
|
#
|
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.
Implements
|
#
|
public
|
singleton(string $abstract, Closure|string|null $concrete = null): void
Register a shared binding in the container.
Register a shared binding in the container.
Implements
|
#
|
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.
Implements
|
#
|
public
|
scoped(string $abstract, Closure|string|null $concrete = null): void
Register a scoped binding in the container.
Register a scoped binding in the container.
|
#
|
public
|
scopedIf(string $abstract, Closure|string|null $concrete = null): void
Register a scoped binding if it hasn't already been registered.
Register a scoped binding if it hasn't already been registered.
|
#
|
public
|
extend(string $abstract, Closure $closure): void
"Extend" an abstract type in the container.
"Extend" an abstract type in the container.
Throws
Implements
|
#
|
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.
Implements
|
#
|
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.
Implements
|
#
|
public
|
tagged(string $tag): iterable
Resolve all of the bindings for a given tag.
Resolve all of the bindings for a given tag.
Implements
|
#
|
public
|
alias(string $abstract, string $alias): void
Alias a type to a different name.
Alias a type to a different name.
Throws
Implements
|
#
|
public
|
rebinding(string $abstract, Closure $callback): mixed
Bind a new callback to an abstract's rebind event.
Bind a new callback to an abstract's rebind event.
|
#
|
public
|
refresh(string $abstract, mixed $target, string $method): mixed
Refresh an instance on the given target and method.
Refresh an instance on the given target and method.
|
#
|
public
|
wrap(Closure $callback, array $parameters = []): Closure
Wrap the given closure such that its dependencies will be injected when executed.
Wrap the given closure such that its dependencies will be injected when executed.
|
#
|
public
|
call(callable|string $callback, array<string, mixed> $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.
Throws
Implements
|
#
|
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.
Implements
|
#
|
public
|
makeWith(string|callable $abstract, array $parameters = []): mixed
An alias function name for make().
An alias function name for make().
Throws
|
#
|
public
|
make(string|callable $abstract, array $parameters = []): mixed
Resolve the given type from the container.
Resolve the given type from the container.
Throws
Implements
|
#
|
public
|
get($id): mixed
{@inheritdoc}
Parameters
$id |
Identifier of the entry to look for.
|
Returns
Implements
|
#
|
public
|
build(Closure|string $concrete): mixed
Instantiate a concrete instance of the given type.
Instantiate a concrete instance of the given type.
Throws
|
#
|
public
|
beforeResolving(Closure|string $abstract, Closure|null $callback = null): void
Register a new before resolving callback for all types.
Register a new before resolving callback for all types.
|
#
|
public
|
resolving(Closure|string $abstract, Closure|null $callback = null): void
Register a new resolving callback.
Register a new resolving callback.
Implements
|
#
|
public
|
afterResolving(Closure|string $abstract, Closure|null $callback = null): void
Register a new after resolving callback for all types.
Register a new after resolving callback for all types.
Implements
|
#
|
public
|
getBindings(): array
Get the container's bindings.
Get the container's bindings.
|
#
|
public
|
getAlias(string $abstract): string
Get the alias for an abstract if available.
Get the alias for an abstract if available.
|
#
|
public
|
forgetExtenders(string $abstract): void
Remove all of the extender callbacks for a given type.
Remove all of the extender callbacks for a given type.
|
#
|
public
|
forgetInstance(string $abstract): void
Remove a resolved instance from the instance cache.
Remove a resolved instance from the instance cache.
|
#
|
public
|
forgetInstances(): void
Clear all of the instances from the container.
Clear all of the instances from the container.
|
#
|
public
|
forgetScopedInstances(): void
Clear all of the scoped instances from the container.
Clear all of the scoped instances from the container.
|
#
|
public
|
flush(): void
Flush the container of all bindings and resolved instances.
Flush the container of all bindings and resolved instances.
Implements
|
#
|
public
static
|
getInstance(): static
Get the globally available instance of the container.
Get the globally available instance of the container.
|
#
|
public
static
|
setInstance(Container|null $container = null): Container|static
Set the shared instance of the container.
Set the shared instance of the container.
|
#
|
public
|
offsetExists(string $key): bool
Determine if a given offset exists.
Determine if a given offset exists.
Implements
|
#
|
public
|
offsetGet(string $key): mixed
Get the value at a given offset.
Get the value at a given offset.
Implements
|
#
|
public
|
offsetSet(string $key, mixed $value): void
Set the value at a given offset.
Set the value at a given offset.
Implements
|
#
|
public
|
offsetUnset(string $key): void
Unset the value at a given offset.
Unset the value at a given offset.
Implements
|
#
|
public
|
__get(string $key): mixed
Dynamically access container services.
Dynamically access container services.
|
#
|
public
|
__set(string $key, mixed $value): void
Dynamically set container services.
Dynamically set container services.
|
#
|