original_string: public function createService(ServiceLocatorInterface $serviceLocator)
      {
          $mm = $serviceLocator->get('ModuleManager');
          $mm->loadModules();
          $moduleParams = $mm->getEvent()->getParams();
  
          $config = ArrayUtils::merge(
              $moduleParams['configListener']->getMergedConfig(false),
              $serviceLocator->get('ApplicationConfig')
          );
  
          $parametersBag = $serviceLocator->get('ApplicationParameters');
  
          $config['parameters'] = isset($config['parameters']) ?
              ArrayUtils::merge($parametersBag->all(), $config['parameters']) :
              $config['parameters'] = $parametersBag->all();
  
          return $parametersBag->resolveArray($config);
      }
code: public function createService(ServiceLocatorInterface $serviceLocator)
      {
          $mm = $serviceLocator->get('ModuleManager');
          $mm->loadModules();
          $moduleParams = $mm->getEvent()->getParams();
  
          $config = ArrayUtils::merge(
              $moduleParams['configListener']->getMergedConfig(false),
              $serviceLocator->get('ApplicationConfig')
          );
  
          $parametersBag = $serviceLocator->get('ApplicationParameters');
  
          $config['parameters'] = isset($config['parameters']) ?
              ArrayUtils::merge($parametersBag->all(), $config['parameters']) :
              $config['parameters'] = $parametersBag->all();
  
          return $parametersBag->resolveArray($config);
      }
code_tokens: public function createService ( ServiceLocatorInterface $ serviceLocator ) { $ mm = $ serviceLocator -> get ( 'ModuleManager' ) ; $ mm -> loadModules ( ) ; $ moduleParams = $ mm -> getEvent ( ) -> getParams ( ) ; $ config = ArrayUtils :: merge ( $ moduleParams [ 'configListener' ] -> getMergedConfig ( false ) , $ serviceLocator -> get ( 'ApplicationConfig' ) ) ; $ parametersBag = $ serviceLocator -> get ( 'ApplicationParameters' ) ; $ config [ 'parameters' ] = isset ( $ config [ 'parameters' ] ) ? ArrayUtils :: merge ( $ parametersBag -> all ( ) , $ config [ 'parameters' ] ) : $ config [ 'parameters' ] = $ parametersBag -> all ( ) ; return $ parametersBag -> resolveArray ( $ config ) ; }
docstring: Create the application configuration service.
  
  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.
  
  @param ServiceLocatorInterface $serviceLocator
  
  @return array|\Traversable
docstring_tokens: Create the application configuration service .