Zend\Mvc\Service\ConfigFactory::__invoke PHP Method

__invoke() public method

Retrieves the Module Manager from the service locator, and executes {@link Zend\ModuleManager\ModuleManager::loadModules()}. It then retrieves the config listener from the module manager, and from that the merged configuration.
public __invoke ( Interop\Container\ContainerInterface $container, string $name, array $options = null ) : array | Traversable
$container Interop\Container\ContainerInterface
$name string
$options array
return array | Traversable
    public function __invoke(ContainerInterface $container, $name, array $options = null)
    {
        $moduleManager = $container->get('ModuleManager');
        $moduleManager->loadModules();
        $moduleParams = $moduleManager->getEvent()->getParams();
        return $moduleParams['configListener']->getMergedConfig(false);
    }