Looking over the code in more detail, the simplest way this can be achieved is by making some small modifications to the Zend\Stdlib\CallbackHandler class by broadening the definition of 'callback'. From my understanding, the intent of the CallbackHandler is to abstract PHP callbacks, and while doing so it might also escape from the limited definition given by is_callable.
A callback could also be represented by an array with 2 elements, the first one implementing a Zend\Di\Locator interface and the second one being a string (representing a service name). array( $locator, $name ); The CallbackHandler::getCallback() function could then call on the Locator's get() method passing in the $name in order to obtain an instance of service. Making the CallbackHandler depend on a Di interface might be weird and unrecommended, so a solution would be to move the Locator interface to the Stdlib package. -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/ZF2-Di-EventManager-tp4485022p4492091.html Sent from the Zend Framework mailing list archive at Nabble.com. -- List: [email protected] Info: http://framework.zend.com/archives Unsubscribe: [email protected]
