\Horde_Injector_Binder_AnnotatedSetters

This is a binder that finds methods marked with @inject and calls them with their dependencies. It must be stacked on another binder that actually creates the instance.

Summary

Methods
Properties
Constants
__construct()
equals()
getBinder()
create()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
_findAnnotatedSetters()
_isSetterMethod()
_callSetters()
$_binder
$_dependencyFinder
N/A

Properties

Methods

equals()

equals(\Horde_Injector_Binder  $otherBinder) : boolean

Determine if one binder equals another binder

Parameters

\Horde_Injector_Binder $otherBinder

Returns

boolean —

Equality.

create()

create(\Horde_Injector  $injector) : mixed

Create an instance.

Parameters

\Horde_Injector $injector

The injector should provide all required dependencies for creating the instance.

Returns

mixed —

The concrete instance.

_findAnnotatedSetters()

_findAnnotatedSetters(\ReflectionClass  $reflectionClass) : array

Find all public methods in $reflectionClass that are annotated with

Parameters

\ReflectionClass $reflectionClass

Returns

array

_isSetterMethod()

_isSetterMethod(\ReflectionMethod  $reflectionMethod) 

Is a method a setter method, by the criteria we define (has a doc comment that includes @inject).

Parameters

\ReflectionMethod $reflectionMethod

_callSetters()

_callSetters(array  $setters, \Horde_Injector  $injector, object  $instance) 

Call each ReflectionMethod in the $setters array, filling in its dependencies with the $injector.

Parameters

array $setters

Array of ReflectionMethods to call.

\Horde_Injector $injector

The injector to get dependencies from.

object $instance

The object to call setters on.