Skip to documentation

AutowireContainer

Class
implements ContainerInterface
Read only: Yes Final: Yes

Resolves services through an optional delegate and native constructor autowiring.

Description

Explicit delegate entries take precedence over autowiring. Without a delegate, an empty aggregate is created to resolve concrete dependency graphs directly.

Table of Contents

Interfaces

ContainerInterface

Extends the PSR-11 ContainerInterface to provide a consistent, domain-specific container interface for the FastForward ecosystem.

Properties

 : ContainerInterface

Methods

__construct()

Constructs the AutowireContainer.

 : mixed
get()

Retrieves an entry from the container by its identifier.

 : mixed
has()

Checks whether the composed container knows the entry without calling get().

 : bool
Properties

$container

Private
private ContainerInterface $container

Description

the internal composite container with autowiring support

Methods

__construct()

Public

Constructs the AutowireContainer.

public __construct([ContainerInterface|null  $delegateContainer = null]) : mixed

Description

Omission or null creates an empty AggregateContainer. An existing aggregate is reused; other PSR-11 containers are wrapped. Autowiring is appended last so delegate entries take precedence, including for nested dependencies.

Parameters
$delegateContainer : ContainerInterface|null = null

Description

the optional delegate to wrap and extend

get()

Public

Retrieves an entry from the container by its identifier.

public get( string  $id) : mixed
Parameters
$id : string

Description

identifier of the entry to retrieve

Tags
throws
NotFoundExceptionInterface

Description

if the identifier is not found

throws
ContainerExceptionInterface

Description

if the entry cannot be resolved

Return values

Description

the resolved entry

has()

Public

Checks whether the composed container knows the entry without calling get().

public has( string  $id) : bool
Parameters
$id : string

Description

the entry identifier

Tags
throws
ContainerExceptionInterface

Description

if delegated lookup or class loading fails

Return values
bool

Description

whether an entry or instantiable class is known

Search results