Repository navigation
ContainerBuilder
Registers ordered initializers and builds independent container compositions.
Registration SHALL retain source objects and class names without resolving services. Each build() MUST create a fresh aggregate, provider/config adapters, and autowiring container. Supplied PSR-11 containers SHALL be reused without cloning their state.
Later registrations SHALL affect subsequent builds only. Provider adapters SHALL receive their build's aggregate so dependencies can resolve across all sources.
- Full name:
\FastForward\Container\ContainerBuilder - This class is marked as final and can't be subclassed
- This class is a Final class
Registers one or more initializers for subsequent builds.
public add(\FastForward\Config\ConfigInterface|\Psr\Container\ContainerInterface|\Interop\Container\ServiceProviderInterface|string $initializers): selfThis method SHALL append sources in their supplied order and return this builder. Class names SHALL be instantiated and adapted when build() is called. Previously built containers MUST NOT be changed by later registrations.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$initializers |
\FastForward\Config\ConfigInterface|\Psr\Container\ContainerInterface|\Interop\Container\ServiceProviderInterface|string | the configuration objects, containers, providers, or initializer class names |
Return Value:
this builder for incremental, fluent registration
Creates a fresh container stack from the registered initializers.
public build(): \FastForward\Container\ContainerInterfaceThis method SHALL adapt sources in registration order, append optional configured sources, and return an AutowireContainer wrapping the completed aggregate. Class names MUST be instantiable without required constructor arguments. The builder SHALL retain registrations without retaining assembled container state.
Return Value:
the composed and autowire-enabled container
Throws:
if an initializer class cannot be found or adapted