$_closure
$_closure : \Horde_Injector_Binder_Closure
A binder object for binding an interface to a closure.
An interface may be bound to a closure. That closure must accept a Horde_Injector and return an object that satisfies the instance requirement. For example:
$injector->bindClosure('database', function($injector) { return new my_mysql(); });
$_closure : \Horde_Injector_Binder_Closure
equals(\Horde_Injector_Binder $otherBinder) : boolean
Determine if one binder equals another binder
\Horde_Injector_Binder | $otherBinder |
Equality.
create(\Horde_Injector $injector) : \Horde_Injector
Create instance using a closure.
If the closure depends on a Horde_Injector we want to limit its scope so it cannot change anything that effects any higher-level scope. A closure should not have the responsibility of making a higher-level scope change. To enforce this we create a new child Horde_Injector. When a Horde_Injector is requested from a Horde_Injector it will return itself. This means that the closure will only ever be able to work on the child Horde_Injector we give it now.
\Horde_Injector | $injector | Injector object. |