/**
  * Validate and inject plugin manager options into the service listener.
  *
  * @param array $options
  * @param ServiceListenerInterface $serviceListener
  * @throws ServiceListenerInterface for invalid $options types
  */
 private function injectServiceListenerOptions($options, ServiceListenerInterface $serviceListener)
 {
     if (!is_array($options)) {
         throw new ServiceNotCreatedException(sprintf('The value of service_listener_options must be an array, %s given.', is_object($options) ? get_class($options) : gettype($options)));
     }
     foreach ($options as $key => $newServiceManager) {
         $this->validatePluginManagerOptions($newServiceManager, $key);
         $serviceListener->addServiceManager($newServiceManager['service_manager'], $newServiceManager['config_key'], $newServiceManager['interface'], $newServiceManager['method']);
     }
 }
 /**
  * @param ServiceListenerInterface $serviceListener
  * @return ServiceListenerInterface
  */
 public static function registerListenerAggregatesPluginManager(ServiceListenerInterface $serviceListener)
 {
     return $serviceListener->addServiceManager('ListenerAggregates', 'listener_aggregates', '\\Abacaphiliac\\Zend\\EventManager\\PluginManager\\ListenerAggregate\\ListenerAggregatesProviderInterface', 'getListenerAggregatesConfig');
 }