PHP Class Symfony\Component\DependencyInjection\InterfaceInjector

Author: Bulat Shakirzyanov ([email protected])
Show file Open project: pmjones/php-framework-benchmarks Class Usage Examples

Protected Properties

Property Type Description
$calls
$class
$processedDefinitions

Public Methods

Method Description
__construct ( string $class ) Contructs interface injector by specifying the target class name
addMethodCall ( string $method, array $arguments = [] ) : InterfaceInjector Adds a method to call to be injected on any service implementing the interface.
getClass ( ) : string Returns the interface name
getMethodCalls ( ) : array Gets the methods to call after service initialization.
hasMethodCall ( string $method ) : boolean Check if the current definition has a given method to call after service initialization.
merge ( InterfaceInjector $injector ) Merges another InterfaceInjector
processDefinition ( Definition $definition, $class = null ) : void Adds method calls if Definition is of required interface
removeMethodCall ( string $method ) : Definition Removes a method to call after service initialization.
supports ( string $object ) : boolean Inspects if current interface injector is to be used with a given class

Method Details

__construct() public method

Contructs interface injector by specifying the target class name
public __construct ( string $class )
$class string

addMethodCall() public method

Adds a method to call to be injected on any service implementing the interface.
public addMethodCall ( string $method, array $arguments = [] ) : InterfaceInjector
$method string The method name to call
$arguments array An array of arguments to pass to the method call
return InterfaceInjector The current instance

getClass() public method

Returns the interface name
public getClass ( ) : string
return string

getMethodCalls() public method

Gets the methods to call after service initialization.
public getMethodCalls ( ) : array
return array An array of method calls

hasMethodCall() public method

Check if the current definition has a given method to call after service initialization.
public hasMethodCall ( string $method ) : boolean
$method string The method name to search for
return boolean

merge() public method

Merges another InterfaceInjector
public merge ( InterfaceInjector $injector )
$injector InterfaceInjector

processDefinition() public method

Adds method calls if Definition is of required interface
public processDefinition ( Definition $definition, $class = null ) : void
$definition Definition
return void

removeMethodCall() public method

Removes a method to call after service initialization.
public removeMethodCall ( string $method ) : Definition
$method string The method name to remove
return Definition The current instance

supports() public method

Inspects if current interface injector is to be used with a given class
public supports ( string $object ) : boolean
$object string
return boolean

Property Details

$calls protected property

protected $calls

$class protected property

protected $class

$processedDefinitions protected property

protected $processedDefinitions