Menu

## FactoryResolver
in package
implements DefinitionResolver

FactoryResolver.php : 28

Resolves a factory definition to a value.

##### Tags

template-implements

  DefinitionResolver<FactoryDefinition>

since
  4.0
author

  Matthieu Napoli matthieu@mnapoli.fr

### Table of Contents

#### Interfaces

DefinitionResolver
  Resolves a definition to a value.

#### Properties

$container : ContainerInterface
$invoker : Invoker|null
$resolver : DefinitionResolver

#### Methods

__construct() : mixed
  The resolver needs a container. This container will be passed to the factory as a parameter so that the factory can access other entries of the container.
isResolvable() : bool
  Check if a definition can be resolved.
resolve() : mixed
  Resolve a factory definition to a value.
resolveExtraParams() : array<string|int, mixed>

### Properties

#### $container

FactoryResolver.php : 37
`private ContainerInterface $container`

#### $invoker

FactoryResolver.php : 30
`private Invoker|null $invoker = null`

#### $resolver

FactoryResolver.php : 38
`private DefinitionResolver $resolver`

### Methods

#### __construct()

FactoryResolver.php : 36

The resolver needs a container. This container will be passed to the factory as a parameter so that the factory can access other entries of the container.

`public __construct(ContainerInterface $container, DefinitionResolver $resolver) : mixed`

##### Parameters

$container : ContainerInterface
$resolver : DefinitionResolver

#### isResolvable()

FactoryResolver.php : 94

Check if a definition can be resolved.

`public isResolvable(Definition $definition[, array<string|int, mixed> $parameters = [] ]) : bool`

##### Parameters

$definition : Definition

  Object that defines how the value should be obtained.

$parameters : array<string|int, mixed> = []

  Optional parameters to use to build the entry.

##### Return values

bool

#### resolve()

FactoryResolver.php : 49

Resolve a factory definition to a value.

`public resolve(FactoryDefinition $definition[, array<string|int, mixed> $parameters = [] ]) : mixed`

This will call the callable of the definition.

##### Parameters

$definition : FactoryDefinition
$parameters : array<string|int, mixed> = []

  Optional parameters to use to build the entry.

##### Return values

mixed —

Value obtained from the definition.

#### resolveExtraParams()

FactoryResolver.php : 99
`private resolveExtraParams(array<string|int, mixed> $params) : array<string|int, mixed>`

##### Parameters

$params : array<string|int, mixed>

##### Return values

array<string|int, mixed>

## Search results