Allow the Implementation binder to create its own DependencyFinder if one isn't passe...
authorChuck Hagenbuch <chuck@horde.org>
Tue, 1 Jun 2010 14:15:58 +0000 (10:15 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Tue, 1 Jun 2010 14:17:22 +0000 (10:17 -0400)
This isn't "pure", but it still lets the DependencyFinder be injected, and it
also makes bindImplementation() work again without any other hacks or extra
arguments.

framework/Injector/lib/Horde/Injector/Binder/Implementation.php

index 56f4b6f..ebfe253 100644 (file)
@@ -22,9 +22,13 @@ class Horde_Injector_Binder_Implementation implements Horde_Injector_Binder
     /**
      * TODO
      */
-    public function __construct($implementation, Horde_Injector_DependencyFinder $dependencyFinder)
+    public function __construct($implementation, Horde_Injector_DependencyFinder $dependencyFinder = null)
     {
         $this->_implementation = $implementation;
+
+        if (is_null($dependencyFinder)) {
+            $dependencyFinder = new Horde_Injector_DependencyFinder();
+        }
         $this->_dependencyFinder = $dependencyFinder;
     }