PHP Class DI\Definition\Helper\FactoryDefinitionHelper

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

Public Methods

Method 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 method

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

getDefinition() public method

public getDefinition ( string $entryName ) : FactoryDefinition
$entryName string Container entry name
return DI\Definition\FactoryDefinition

parameter() public method

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.
return FactoryDefinitionHelper

scope() public method

Defines the scope of the entry.
public scope ( string $scope ) : FactoryDefinitionHelper
$scope string
return FactoryDefinitionHelper