Container
Interfaces
Extends the PSR-11 ContainerInterface to provide a consistent, domain-specific container interface for the FastForward ecosystem.
Defines a contract for service factories that rely on a PSR-11 container for instantiation.
Classes
Aggregates multiple PSR-11 containers and delegates resolution requests among them.
Exception thrown when an invalid or unsupported argument is passed to a function or method within the container.
Exception thrown when a requested service identifier is not found in the container.
This factory wraps a predefined service instance and returns it directly upon invocation.
Implements a PSR-11 compliant dependency injection container using a container-interop/service-provider.
Functions
Creates and assembles a fully composed container instance.
Creates and assembles a fully composed container instance.
container(ConfigInterface|ContainerInterface|ServiceProviderInterface|string
...$initializers) : ContainerInterface
Description
This convenience function delegates composition to ContainerFactory::create(). Accepted initializers include:
- PSR-11 container instances
- Service providers implementing ServiceProviderInterface
- Configuration instances implementing ConfigInterface
- Class names as strings (which MUST be instantiable)
If a ConfigContainer is included, it SHALL attempt to resolve additional nested container
definitions from its configuration using the key ${alias}.${ContainerInterface::class}.
Unknown initializer classes and unsupported constructed objects MUST result in
an InvalidArgumentException being thrown.
The final container returned is an AutowireContainer that wraps an AggregateContainer composed of all resolved sources.
Parameters
$initializers
:
ConfigInterface|ContainerInterface|ServiceProviderInterface|string
Description
A variadic list of container initializers, optionally including config or provider classes.
Return values
Description
the composed and autowire-enabled container