AutowireContainer

Class
implements ContainerInterface
Read only: Yes Final: Yes

A composite container implementation that wraps another PSR-11 container and appends an internal PHP-DI autowiring container.

Description

It provides auto-resolution of services while maintaining compatibility with pre-defined service providers.

This container MUST be used in scenarios where automatic dependency resolution via autowiring is required alongside explicitly registered services.

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
 : bool
Properties

$container

Private
private ContainerInterface $container

Description

the internal composite container with autowiring support

Methods

__construct()

Public

Constructs the AutowireContainer.

public __construct(ContainerInterface  $delegateContainer) : mixed

Description

If the provided container is not an AggregateContainer, it is wrapped within one. A PHP-DI container is appended to the aggregate to support autowiring.

Parameters
$delegateContainer : ContainerInterface

Description

the delegate container 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
public has( string  $id) : bool
Parameters
$id : string
Return values
bool