public function mapConfig(array $config, $mapper)
    {
        $mapperCallable = is_callable($mapper);
        if (!$mapperCallable && !$mapper instanceof ConfigurationMapperInterface) {
            throw new InvalidArgumentException('Configuration mapper must either be a callable or an instance of ConfigurationMapper.');
        }

        if ($mapper instanceof HookableConfigurationMapperInterface) {
            $mapper->preMap($config, $this->contextualizer);
        }

        $scopeNodeName = $this->contextualizer->getSiteAccessNodeName();
        foreach ($config[$scopeNodeName] as $currentScope => &$scopeSettings) {
            if ($mapperCallable) {
                call_user_func_array($mapper, array(&$scopeSettings, $currentScope, $this->contextualizer));
            } else {
                $mapper->mapConfig($scopeSettings, $currentScope, $this->contextualizer);
            }
        }

        if ($mapper instanceof HookableConfigurationMapperInterface) {
            $mapper->postMap($config, $this->contextualizer);
        }
    }
public function mapConfig(array $config, $mapper)
    {
        $mapperCallable = is_callable($mapper);
        if (!$mapperCallable && !$mapper instanceof ConfigurationMapperInterface) {
            throw new InvalidArgumentException('Configuration mapper must either be a callable or an instance of ConfigurationMapper.');
        }

        if ($mapper instanceof HookableConfigurationMapperInterface) {
            $mapper->preMap($config, $this->contextualizer);
        }

        $scopeNodeName = $this->contextualizer->getSiteAccessNodeName();
        foreach ($config[$scopeNodeName] as $currentScope => &$scopeSettings) {
            if ($mapperCallable) {
                call_user_func_array($mapper, array(&$scopeSettings, $currentScope, $this->contextualizer));
            } else {
                $mapper->mapConfig($scopeSettings, $currentScope, $this->contextualizer);
            }
        }

        if ($mapper instanceof HookableConfigurationMapperInterface) {
            $mapper->postMap($config, $this->contextualizer);
        }
    }
public function mapConfig ( array $ config , $ mapper ) { $ mapperCallable = is_callable ( $ mapper ) ; if ( ! $ mapperCallable && ! $ mapper instanceof ConfigurationMapperInterface ) { throw new InvalidArgumentException ( 'Configuration mapper must either be a callable or an instance of ConfigurationMapper.' ) ; } if ( $ mapper instanceof HookableConfigurationMapperInterface ) { $ mapper -> preMap ( $ config , $ this -> contextualizer ) ; } $ scopeNodeName = $ this -> contextualizer -> getSiteAccessNodeName ( ) ; foreach ( $ config [ $ scopeNodeName ] as $ currentScope => & $ scopeSettings ) { if ( $ mapperCallable ) { call_user_func_array ( $ mapper , array ( & $ scopeSettings , $ currentScope , $ this -> contextualizer ) ) ; } else { $ mapper -> mapConfig ( $ scopeSettings , $ currentScope , $ this -> contextualizer ) ; } } if ( $ mapper instanceof HookableConfigurationMapperInterface ) { $ mapper -> postMap ( $ config , $ this -> contextualizer ) ; } }
Triggers mapping process between semantic and internal configuration.

@param array $config Parsed semantic configuration
@param ConfigurationMapperInterface|callable $mapper Mapper to use. Can be either an instance of ConfigurationMapper or a callable.
HookableConfigurationMapper can also be used. In this case, preMap()
and postMap() will be also called respectively before and after the mapping loop.

If $mapper is a callable, the same arguments as defined in the signature
defined in ConfigurationMapper interface will be passed:
`array $scopeSettings, $currentScope, ContextualizerInterface $contextualizer`

@throws \InvalidArgumentException
Triggers mapping process between semantic and internal configuration .