From: Chuck Hagenbuch Date: Tue, 1 Jun 2010 14:15:58 +0000 (-0400) Subject: Allow the Implementation binder to create its own DependencyFinder if one isn't passe... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=24ef0329068097d1e18d970e2e9795cd2f6c6922;p=horde.git Allow the Implementation binder to create its own DependencyFinder if one isn't passed in. 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. --- diff --git a/framework/Injector/lib/Horde/Injector/Binder/Implementation.php b/framework/Injector/lib/Horde/Injector/Binder/Implementation.php index 56f4b6fbb..ebfe253c2 100644 --- a/framework/Injector/lib/Horde/Injector/Binder/Implementation.php +++ b/framework/Injector/lib/Horde/Injector/Binder/Implementation.php @@ -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; }