Skip to content
This repository has been archived by the owner on Feb 6, 2020. It is now read-only.

Fix code in doc/book which produce fatal errors #90

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/book/configuring-the-service-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ closure. This leads to more readable code. For instance:

class MyObjectFactory implements FactoryInterface
{
public function __invoke(ContainerInterface $container, $requestedName)
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
$dependency = $container->get(stdClass::class);
return new MyObject($dependency);
Expand Down Expand Up @@ -123,7 +123,7 @@ For instance, if two services share the same creation pattern, you could attach

class MyObjectFactory implements FactoryInterface
{
public function __invoke(ContainerInterface $container, $requestedName)
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
$dependency = $container->get(stdClass::class);
return new $requestedName($dependency);
Expand Down Expand Up @@ -175,7 +175,7 @@ class MyAbstractFactory implements AbstractFactoryInterface
return in_array('Traversable', class_implements($requestedName), true);
}

public function __invoke(ContainerInterface $container, $requestedName)
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
return $requestedName();
}
Expand Down Expand Up @@ -292,7 +292,7 @@ Alternately, you can create a class that implements

class MyInitializer implements InitializerInterface
{
public function __invoke(ServiceLocatorInterface $serviceLocator, $instance)
public function __invoke(ContainerInterface $container, $instance)
{
if (! $instance instanceof EventManagerAwareInterface) {
return;
Expand Down