FileAccess Orion

DelegatorFactoryInterface extends DelegatorFactoryInterface

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 to Interop\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
  • 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
deprecated

Use Zend\ServiceManager\Factory\DelegatorFactoryInterface instead.

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
throws
ServiceNotFoundException

if unable to resolve the service.

throws
ServiceNotCreatedException

if an exception is raised when creating a service.

throws
ContainerException

if any other error occurs

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

Return values
mixed

Search results