@@ -88,7 +88,7 @@ closure. This leads to more readable code. For instance:
88
88
89
89
class MyObjectFactory implements FactoryInterface
90
90
{
91
- public function __invoke(ContainerInterface $container, $requestedName)
91
+ public function __invoke(ContainerInterface $container, $requestedName, array $options = null )
92
92
{
93
93
$dependency = $container->get(stdClass::class);
94
94
return new MyObject($dependency);
@@ -123,7 +123,7 @@ For instance, if two services share the same creation pattern, you could attach
123
123
124
124
class MyObjectFactory implements FactoryInterface
125
125
{
126
- public function __invoke(ContainerInterface $container, $requestedName)
126
+ public function __invoke(ContainerInterface $container, $requestedName, array $options = null )
127
127
{
128
128
$dependency = $container->get(stdClass::class);
129
129
return new $requestedName($dependency);
@@ -175,7 +175,7 @@ class MyAbstractFactory implements AbstractFactoryInterface
175
175
return in_array('Traversable', class_implements($requestedName), true);
176
176
}
177
177
178
- public function __invoke(ContainerInterface $container, $requestedName)
178
+ public function __invoke(ContainerInterface $container, $requestedName, array $options = null )
179
179
{
180
180
return $requestedName();
181
181
}
@@ -292,7 +292,7 @@ Alternately, you can create a class that implements
292
292
293
293
class MyInitializer implements InitializerInterface
294
294
{
295
- public function __invoke(ServiceLocatorInterface $serviceLocator , $instance)
295
+ public function __invoke(ContainerInterface $container , $instance)
296
296
{
297
297
if (! $instance instanceof EventManagerAwareInterface) {
298
298
return;
0 commit comments