class ContainerBuilder (View source)

Class that provides convenience functionality for setting up containers.

Methods

__construct()

ContainerBuilder constructor.

getContainer()

Returns the container that is being built.

void
registerConfiguration(array $configuration)

Registers an array with identifier value pairs to the container as mixed entries.

void
registerProvider(EntryProvider $provider)

Registers the given provider as a callable and applicable methods as provider methods.

void
registerAutowiredClasses(array $classes, array $overrides = [])

Registers classes that can be wired automatically based on constructor arguments.

Details

__construct()

ContainerBuilder constructor.

Container getContainer()

Returns the container that is being built.

Return Value

Container The container that is being built

void registerConfiguration(array $configuration)

Registers an array with identifier value pairs to the container as mixed entries.

Parameters

array $configuration The configuration array to register

Return Value

void

Exceptions

ContainerException If trying to register values that already exist

void registerProvider(EntryProvider $provider)

Registers the given provider as a callable and applicable methods as provider methods.

Parameters

EntryProvider $provider The entry provider to register

Return Value

void

Exceptions

ContainerException If the provider tries to provide something that has already been registered

void registerAutowiredClasses(array $classes, array $overrides = [])

Registers classes that can be wired automatically based on constructor arguments.

Parameters

array $classes List of classes to register for autowiring
array $overrides Override identifiers for constructor parameters

Return Value

void

Exceptions

ContainerException If trying to register classes that have already been registered