Author: Bob Mckee (bmckee@bywires.com)
Author: James Pepin (james@jamespepin.com)
Esempio n. 1
0
 /**
  */
 public function create(Horde_Injector $injector)
 {
     $instance = $this->_binder->create($injector);
     try {
         $reflectionClass = new ReflectionClass(get_class($instance));
     } catch (ReflectionException $e) {
         throw new Horde_Injector_Exception($e);
     }
     $setters = $this->_findAnnotatedSetters($reflectionClass);
     $this->_callSetters($setters, $injector, $instance);
     return $instance;
 }
Esempio n. 2
0
 /**
  * @param Horde_Injector_Binder $otherBinder
  *
  * @return boolean  Equality.
  */
 public function equals(Horde_Injector_Binder $otherBinder)
 {
     return $otherBinder instanceof Horde_Injector_Binder_Factory && $otherBinder->getFactory() == $this->_factory && $otherBinder->getMethod() == $this->_method;
 }
Esempio n. 3
0
 /**
  * @param Horde_Injector_Binder $otherBinder
  *
  * @return boolean  Equality.
  */
 public function equals(Horde_Injector_Binder $otherBinder)
 {
     return $otherBinder instanceof Horde_Injector_Binder_Closure && $otherBinder->getClosure() == $this->_closure;
 }
Esempio n. 4
0
 /**
  * @return boolean  Equality.
  */
 public function equals(Horde_Injector_Binder $otherBinder)
 {
     return $otherBinder instanceof Horde_Injector_Binder_Implementation && $otherBinder->getImplementation() == $this->_implementation;
 }
Esempio n. 5
0
 /**
  * @see self::addBinder()
  */
 private function _addBinder($interface, Horde_Injector_Binder $binder)
 {
     // First we check to see if our parent already has an equal binder set.
     // if so we don't need to do anything
     if (!$binder->equals($this->_parentInjector->getBinder($interface))) {
         $this->_bindings[$interface] = $binder;
     }
 }