FactoryInterface
extends
FactoryInterface
in
Backwards-compatibility shim for FactoryInterface.
Implementations should update to implement only Zend\ServiceManager\Factory\FactoryInterface.
If upgrading from v2, take the following steps:
- rename the method
createService()
to__invoke()
, and:- rename the
$serviceLocator
argument to$container
, and change the typehint toInterop\Container\ContainerInterface
- add the
$requestedName
as a second argument - add the optional
array $options = null
argument as a final argument
- rename the
- create a
createService()
method as defined in this interface, and have it proxy to__invoke()
.
Once you have tested your code, you can then update your class to only implement
Zend\ServiceManager\Factory\FactoryInterface, and remove the createService()
method.
Tags
Table of Contents
- __invoke() : object
- Create an object
- createService() : mixed
- Create service
Methods
__invoke()
Create an object
public
__invoke(ContainerInterface $container, string $requestedName[, null|array<string|int, mixed> $options = null ]) : object
Parameters
- $container : ContainerInterface
- $requestedName : string
- $options : null|array<string|int, mixed> = null
Tags
Return values
object —createService()
Create service
public
createService(ServiceLocatorInterface $serviceLocator) : mixed
Parameters
- $serviceLocator : ServiceLocatorInterface