I don't see the need for Reflection. You can make a simple check to see if the 2 element array (passed in as a callback) has the first element as an instanceof Locator. If not, you just make the other checks that are currently made on the callback ... try to see if it is_callable, if it's string, array, etc.
I don't understand why you need to ensure that each EM gets a Locator. I did not suggest injecting a Locator, but merely passing it as a callback (a new type of callback). It is the programmer's job to pass in the Locator as part of the callback, just as it's the programmer's job to pass in the class name and method name with normal callbacks. I also don't understand why an EM should care if listeners can be located. It is the locator's job to care and throw an exception if the service (listener) cannot be located. I understand that this approach of delegating location to a locator (if one is passed in/as the callback) differs from the current way the EM is thought, as right now the EM completely checks callbacks and makes sure they are viable. But i don't see why this is a bad thing. As for coupling, i do agree that it is undesirable, which is why i suggested moving the Locator interface to the Stdlib. -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/ZF2-Di-EventManager-tp4485022p4495774.html Sent from the Zend Framework mailing list archive at Nabble.com. -- List: [email protected] Info: http://framework.zend.com/archives Unsubscribe: [email protected]
