I'm trying to get a Zend\EventManager\EventManager
from a Di
$di = new Di();
$di->configure(new Config(array(/*etc*/));
$events = $di->get('Zend\EventManager\EventManager');
However I get this error
Fatal error: Uncaught exception 'Zend\Di\Exception\RuntimeException' with message 'Invalid instantiator of type "NULL" for "Zend\EventManager\SharedEventManagerInterface".'
I believe it is because EventManagerInterface extends SharedEventManagerInterface?
I have tried
'preferences' => array(
'Zend\EventManager\SharedEventManagerInterface'
=> 'Zend\EventManager\EventManager',
),
and also defining an instantiator
'Zend\EventManager\SharedEventManagerInterface' => array(
'instantiator' => 'Zend\EventManager\EventManager::__construct'
),
What should be the config to over come this error?