Skip to content

ContainerFactory

github-actions[bot] edited this page Oct 12, 2026 · 2 revisions

Composes a fresh aggregate and autowiring container from explicit initializers.

This factory SHALL compose PSR-11 containers, service providers, configuration objects, and initializer class names in their supplied order.

Each call to create() MUST create a fresh aggregate, provider adapters, and autowiring container. The factory SHALL NOT retain assembled container state. Supplied PSR-11 containers SHALL be used directly without cloning their state.

Provider adapters SHALL receive the aggregate as their wrapper so dependencies can be resolved across all sources in the composed stack.


  • Full name: \FastForward\Container\ContainerFactory
  • This class is marked as final and can't be subclassed
  • This class is a Final class

Methods

create

Creates and assembles a fresh container stack.

public static create(\FastForward\Config\ConfigInterface|\Psr\Container\ContainerInterface|\Interop\Container\ServiceProviderInterface|string $initializers): \FastForward\Container\ContainerInterface

This method SHALL adapt each initializer, append optional configured sources, and return an AutowireContainer wrapping the completed aggregate. Initializer class names MUST be instantiable without required constructor arguments.

  • This method is static. Parameters:
Parameter Type Description
$initializers \FastForward\Config\ConfigInterface|\Psr\Container\ContainerInterface|\Interop\Container\ServiceProviderInterface|string the ordered configuration objects, containers, providers, or initializer class names

Return Value:

the composed and autowire-enabled container

Throws:

if an initializer class cannot be found or adapted


Clone this wiki locally