More declarative implementation
authorChuck Hagenbuch <chuck@horde.org>
Thu, 29 Apr 2010 14:59:05 +0000 (10:59 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Thu, 29 Apr 2010 14:59:05 +0000 (10:59 -0400)
framework/Injector/lib/Horde/Injector/Binder/ImplementationWithSetters.php

index 2053bd9..5457877 100644 (file)
@@ -17,15 +17,21 @@ class Horde_Injector_Binder_ImplementationWithSetters extends Horde_Injector_Bin
         $reflectionClass = new ReflectionClass($this->_implementation);
         $this->_validateImplementation($reflectionClass);
         $instance = $this->_getInstance($injector, $reflectionClass);
-        $setters = $this->_findSetters($reflectionClass);
-        foreach ($setters as $setter) {
-            $this->bindSetter($setter);
-        }
+        $this->_bindAnnotatedSetters($reflectionClass);
         $this->_callSetters($injector, $instance);
         return $instance;
     }
 
     /**
+     */
+    private function _bindAnnotatedSetters(ReflectionClass $reflectionClass)
+    {
+        foreach ($this->_findSetters($reflectionClass) as $setter) {
+            $this->bindSetter($setter);
+        }
+    }
+
+    /**
      * Find all public methods in $reflectionClass that are annotated with
      * @inject.
      *