-
Notifications
You must be signed in to change notification settings - Fork 0
CallableFactory
Felipe Sayão Lobato Abreu edited this page Jul 3, 2025
·
2 revisions
A factory that wraps a user-provided callable and executes it when invoked.
The callable MUST accept a PSR-11 ContainerInterface as its first and only argument. This factory SHALL be used when the construction logic must be fully delegated to a closure.
This class allows dynamic resolution of services using the container context.
- Full name:
\FastForward\Container\Factory\CallableFactory
- This class is marked as final and can't be subclassed
- This class implements:
\FastForward\Container\Factory\FactoryInterface
- This class is a Final class
Constructs a CallableFactory instance.
public __construct(callable $callable): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$callable |
callable | a callable that returns a service instance and accepts a container |
Invokes the factory to create a service.
public __invoke(\Psr\Container\ContainerInterface $container): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$container |
\Psr\Container\ContainerInterface | the PSR-11 container for dependency resolution |
Return Value:
the constructed service instance
Automatically generated on 2025-07-03