Skip to documentation

ContainerFactory

Class
Final: Yes

Composes a fresh container through the incremental ContainerBuilder API.

Description

This factory SHALL register the supplied initializers with a new builder and delegate assembly to it. The factory MUST NOT retain assembled container state. Source order, provider wrapper injection, and optional configuration policy SHALL remain consistent with direct builder composition.

Table of Contents

Methods

create()

Creates and assembles a fresh container stack.

 : ContainerInterface
Methods

create()

Public Static

Creates and assembles a fresh container stack.

public static create(ConfigInterface|ContainerInterface|ServiceProviderInterface|string  ...$initializers) : ContainerInterface

Description

This method SHALL pass initializers to a new ContainerBuilder in supplied order. Class names MUST be instantiable without required constructor arguments. Supplied PSR-11 containers SHALL be reused without cloning their state.

Parameters
$initializers : ConfigInterface|ContainerInterface|ServiceProviderInterface|string

Description

the ordered configuration objects, containers, providers, or initializer class names

Tags
throws

Description

if an initializer class cannot be found or adapted

Return values

Description

the composed and autowire-enabled container

Search results