PHP Class DI\Definition\Helper\FactoryDefinitionHelper

Author: Matthieu Napoli ([email protected])
Inheritance: implements DI\Definition\Helper\DefinitionHelper
Afficher le fichier Open project: mnapoli/php-di

Méthodes publiques

Méthode Description
__construct ( callable $factory, boolean $decorate = false )
getDefinition ( string $entryName ) : FactoryDefinition
parameter ( string $parameter, mixed $value ) : FactoryDefinitionHelper Defines arguments to pass to the factory.
scope ( string $scope ) : FactoryDefinitionHelper Defines the scope of the entry.

Method Details

__construct() public méthode

public __construct ( callable $factory, boolean $decorate = false )
$factory callable
$decorate boolean Is the factory decorating a previous definition?

getDefinition() public méthode

public getDefinition ( string $entryName ) : FactoryDefinition
$entryName string Container entry name
Résultat DI\Definition\FactoryDefinition

parameter() public méthode

Because factory methods do not yet support annotations or autowiring, this method should be used to define all parameters except the ContainerInterface and RequestedEntry. Multiple calls can be made to the method to override individual values.
public parameter ( string $parameter, mixed $value ) : FactoryDefinitionHelper
$parameter string Name or index of the parameter for which the value will be given.
$value mixed Value to give to this parameter.
Résultat FactoryDefinitionHelper

scope() public méthode

Defines the scope of the entry.
public scope ( string $scope ) : FactoryDefinitionHelper
$scope string
Résultat FactoryDefinitionHelper