Skip to content

FactoryInterface

Felipe Sayão Lobato Abreu edited this page Jul 3, 2025 · 1 revision

FactoryInterface

Defines a contract for service factories that rely on a PSR-11 container for instantiation.

Implementing classes MUST implement the __invoke method which SHALL be responsible for returning the fully constructed service instance.

This interface is commonly used in container-based systems to register factories dynamically.

  • Full name: \FastForward\Container\Factory\FactoryInterface

Methods

__invoke

Creates a service instance using the provided container.

public __invoke(\Psr\Container\ContainerInterface $container): mixed

Implementations MUST resolve all necessary dependencies from the container and return a fully constructed instance.

Parameters:

Parameter Type Description
$container \Psr\Container\ContainerInterface the PSR-11 compliant container providing dependencies

Return Value:

the created service instance



Automatically generated on 2025-07-03

Clone this wiki locally