public function registerMappings(ConfigInterface $config)
    {
        $configKeys = [
            static::STANDARD_ALIASES     => 'mapAliases',
            static::SHARED_ALIASES       => 'shareAliases',
            static::ARGUMENT_DEFINITIONS => 'defineArguments',
            static::ARGUMENT_PROVIDERS   => 'defineArgumentProviders',
            static::DELEGATIONS          => 'defineDelegations',
            static::PREPARATIONS         => 'definePreparations',
        ];
        try {
            foreach ($configKeys as $key => $method) {
                $$key = $config->hasKey($key)
                    ? $config->getKey($key) : [];
            }
            $standardAliases = array_merge(
                $sharedAliases,
                $standardAliases
            );
        } catch (Exception $exception) {
            throw new InvalidMappingsException(
                sprintf(
                    _('Failed to read needed keys from config. Reason: "%1$s".'),
                    $exception->getMessage()
                )
            );
        }

        try {
            foreach ($configKeys as $key => $method) {
                array_walk($$key, [$this, $method]);
            }
        } catch (Exception $exception) {
            throw new InvalidMappingsException(
                sprintf(
                    _('Failed to set up dependency injector. Reason: "%1$s".'),
                    $exception->getMessage()
                )
            );
        }
    }
public function registerMappings(ConfigInterface $config)
    {
        $configKeys = [
            static::STANDARD_ALIASES     => 'mapAliases',
            static::SHARED_ALIASES       => 'shareAliases',
            static::ARGUMENT_DEFINITIONS => 'defineArguments',
            static::ARGUMENT_PROVIDERS   => 'defineArgumentProviders',
            static::DELEGATIONS          => 'defineDelegations',
            static::PREPARATIONS         => 'definePreparations',
        ];
        try {
            foreach ($configKeys as $key => $method) {
                $$key = $config->hasKey($key)
                    ? $config->getKey($key) : [];
            }
            $standardAliases = array_merge(
                $sharedAliases,
                $standardAliases
            );
        } catch (Exception $exception) {
            throw new InvalidMappingsException(
                sprintf(
                    _('Failed to read needed keys from config. Reason: "%1$s".'),
                    $exception->getMessage()
                )
            );
        }

        try {
            foreach ($configKeys as $key => $method) {
                array_walk($$key, [$this, $method]);
            }
        } catch (Exception $exception) {
            throw new InvalidMappingsException(
                sprintf(
                    _('Failed to set up dependency injector. Reason: "%1$s".'),
                    $exception->getMessage()
                )
            );
        }
    }
public function registerMappings ( ConfigInterface $ config ) { $ configKeys = [ static :: STANDARD_ALIASES => 'mapAliases' , static :: SHARED_ALIASES => 'shareAliases' , static :: ARGUMENT_DEFINITIONS => 'defineArguments' , static :: ARGUMENT_PROVIDERS => 'defineArgumentProviders' , static :: DELEGATIONS => 'defineDelegations' , static :: PREPARATIONS => 'definePreparations' , ] ; try { foreach ( $ configKeys as $ key => $ method ) { $ $ key = $ config -> hasKey ( $ key ) ? $ config -> getKey ( $ key ) : [ ] ; } $ standardAliases = array_merge ( $ sharedAliases , $ standardAliases ) ; } catch ( Exception $ exception ) { throw new InvalidMappingsException ( sprintf ( _ ( 'Failed to read needed keys from config. Reason: "%1$s".' ) , $ exception -> getMessage ( ) ) ) ; } try { foreach ( $ configKeys as $ key => $ method ) { array_walk ( $ $ key , [ $ this , $ method ] ) ; } } catch ( Exception $ exception ) { throw new InvalidMappingsException ( sprintf ( _ ( 'Failed to set up dependency injector. Reason: "%1$s".' ) , $ exception -> getMessage ( ) ) ) ; } }
Register mapping definitions.

Takes a ConfigInterface and reads the following keys to add definitions:
- 'sharedAliases'
- 'standardAliases'
- 'argumentDefinitions'
- 'argumentProviders'
- 'delegations'
- 'preparations'

@since 0.1.0

@param ConfigInterface $config Config file to parse.

@throws InvalidMappingsException If a needed key could not be read from the config file.
@throws InvalidMappingsException If the dependency injector could not be set up.
Register mapping definitions .