DelegatorFactoryInterface
extends
DelegatorFactoryInterface
in
Backwards-compatibility shim for DelegatorFactoryInterface.
Implementations should update to implement only Zend\ServiceManager\Factory\DelegatorFactoryInterface.
If upgrading from v2, take the following steps:
- rename the method
createDelegatorWithName()
to__invoke()
, and:- rename the
$serviceLocator
argument to$container
, and change the typehint toInterop\Container\ContainerInterface
- merge the
$name
and$requestedName
arguments - add the
callable
typehint to the$callback
argument - add the optional
array $options = null
argument as a final argument
- rename the
- create a
createDelegatorWithName()
method as defined in this interface, and have it proxy to__invoke()
, passing$requestedName
as the second argument.
Once you have tested your code, you can then update your class to only implement
Zend\ServiceManager\Factory\DelegatorFactoryInterface, and remove the createDelegatorWithName()
method.
Tags
Table of Contents
- __invoke() : object
- A factory that creates delegates of a given service
- createDelegatorWithName() : mixed
- A factory that creates delegates of a given service
Methods
__invoke()
A factory that creates delegates of a given service
public
__invoke(ContainerInterface $container, string $name, callable $callback[, null|array<string|int, mixed> $options = null ]) : object
Parameters
- $container : ContainerInterface
- $name : string
- $callback : callable
- $options : null|array<string|int, mixed> = null
Tags
Return values
object —createDelegatorWithName()
A factory that creates delegates of a given service
public
createDelegatorWithName(ServiceLocatorInterface $serviceLocator, string $name, string $requestedName, callable $callback) : mixed
Parameters
- $serviceLocator : ServiceLocatorInterface
-
the service locator which requested the service
- $name : string
-
the normalized service name
- $requestedName : string
-
the requested service name
- $callback : callable
-
the callback that is responsible for creating the service