Module.php
public function init(ModuleManagerInterface $manager)
    {
        $integrationModuleListener = null;

        if ($manager instanceof ModuleManager) {
            $event =  $manager->getEvent();
            if ($event instanceof EventInterface) {
                $sl = $event->getParam('ServiceManager');
                if ($sl instanceof ServiceLocatorInterface && $sl->has(IntegrationModuleListenerInterface::class)) {
                    $integrationModuleListener = $sl->get(IntegrationModuleListenerInterface::class);
                }
            }
        }

        if (null === $integrationModuleListener) {
            $integrationModuleListener = new IntegrationModuleListener();
        }

        if (!$integrationModuleListener instanceof IntegrationModuleListenerInterface) {
            $errMsg = sprintf('Integration module listener not implement %s', IntegrationModuleListenerInterface::class);
            throw new Exception\InvalidIntegrationModuleListenerException($errMsg);
        }

        $moduleEventManager = $manager->getEventManager();
        $integrationModuleListener->attach($moduleEventManager);

    }
public function init(ModuleManagerInterface $manager)
    {
        $integrationModuleListener = null;

        if ($manager instanceof ModuleManager) {
            $event =  $manager->getEvent();
            if ($event instanceof EventInterface) {
                $sl = $event->getParam('ServiceManager');
                if ($sl instanceof ServiceLocatorInterface && $sl->has(IntegrationModuleListenerInterface::class)) {
                    $integrationModuleListener = $sl->get(IntegrationModuleListenerInterface::class);
                }
            }
        }

        if (null === $integrationModuleListener) {
            $integrationModuleListener = new IntegrationModuleListener();
        }

        if (!$integrationModuleListener instanceof IntegrationModuleListenerInterface) {
            $errMsg = sprintf('Integration module listener not implement %s', IntegrationModuleListenerInterface::class);
            throw new Exception\InvalidIntegrationModuleListenerException($errMsg);
        }

        $moduleEventManager = $manager->getEventManager();
        $integrationModuleListener->attach($moduleEventManager);

    }
@param ModuleManagerInterface $manager

@throws \Zend\ServiceManager\Exception\ServiceNotFoundException
@throws Exception\InvalidIntegrationModuleListenerException