@param array $config

@return array
762843
private function fixConfigLanguage(array $config)
    {
        if (!isset($config['language']) && ($language = $this->getLanguage()) !== null) {
            $config['language'] = $language;
        }

        if (isset($config['language'])) {
            $config['language'] = strtolower(str_replace('_', '-', $config['language']));
        }

        return $config;
    }
1018426
protected function getReadConfig(array $config)
    {
        $readConfig = $this->getReadWriteConfig($config, 'read');

        return $this->mergeReadWriteConfig($config, $readConfig);
    }
115466
public function postProcessConfiguration(array $config): array
    {
        $config = $this->fixUpViewConfig($config);

        $processor = new ConfigurationProcessor($this->container, $this->extension->getAlias());
        foreach (array_keys($config) as $key) {
            if ($key === 'system' || !in_array($key, self::SITEACCCESS_AWARE_SETTINGS, true)) {
                continue;
            }

            is_array($config[$key]) ?
                $processor->mapConfigArray($key, $config, ContextualizerInterface::MERGE_FROM_SECOND_LEVEL) :
                $processor->mapSetting($key, $config);
        }

        $designList = array_keys($config['design_list']);
        foreach ($config['system'] as $scopeConfig) {
            $this->validateCurrentDesign($scopeConfig['design'], $designList);
        }

        return $config;
    }
1152799
protected function getDefaultOptions($config)
    {
        $defaultOptions = (
            isset($config['defaults']) &&
            is_array($config['defaults']) &&
            isset($config['defaults']['options']) &&
            is_array($config['defaults']['options'])
        )
            ? $config['defaults']['options']
            : [];

        return $defaultOptions;
    }
893312
public function transform(string $config = ''): array
    {
        $parsed = [];
        if (!empty($config)) {
            $decoded = @\json_decode($config, true, 512);
            $parsed = $decoded !== null ? $decoded : [];
        }
        return $parsed;
    }
1335136
private function parseConfig(array $config = [])
    {
        $this->apiConfig = $this->extractGuzzleConfig($config);

        if (ConfigUtils::configurationExists($this->apiConfig, 'apiDescription')) {
            $this->apiDescription = $this->apiConfig['apiDescription'];
        }
        if (ConfigUtils::configurationExists($this->apiConfig, 'authType')) {
            $this->authType = $this->apiConfig['authType'];
        }
        if (ConfigUtils::configurationExists($this->apiConfig, 'debug')) {
            $this->debugMode = $this->apiConfig['debug'];
            if (ConfigUtils::configurationExists($this->apiConfig, 'debugLogger')) {
                $this->debugLogger = $this->apiConfig['debugLogger'];
            }
        }
    }
1202924
public function addFieldsFromConfig(array $config)
    {
        $i = 1;
        foreach ($config as $name => $field) {
            if (is_numeric($name) && !isset($field[$name]['type'])) {
                $fields = [];
                foreach ($field as $n => $f) {
                    $fields[$n] = Fields::create($n, $f);
                }
                if ($i > 1) {
                    $this->fieldsets[$this->current]->createGroup();
                }
                $this->fieldsets[$this->current]->addFields($fields);
                $i++;
            } else {
                $this->addField(Fields::create($name, $field));
            }
        }
        return $this;
    }
239534
protected function normalizeConfig(array $config)
    {
        foreach ($this->configModel as $elmt => $settings) {
            if (!isset($config[$elmt])) {
                $config[$elmt] = $settings['default'];
            }
        }

        foreach ($config as $elmtName => $value) {
            if (!isset($this->configModel[$elmtName])) {
                unset($config[$elmtName]);
            }
        }

        return $config;
    }
129434
protected function getConfig(array $config): array
    {
        $keys = [
            'auth_key',
            'secret',
            'app_id',
            'options',
            'host',
            'port',
            'timeout',
        ];

        foreach ($keys as $key) {
            if (!array_key_exists($key, $config)) {
                throw new InvalidArgumentException("Missing configuration key [$key].");
            }
        }

        foreach ($config['options'] as $option => $value) {
            if (is_null($value)) {
                unset($config['options'][$option]);
            }
        }

        return array_only($config, $keys);
    }
315558
protected function getOptions(array $config)
    {
        $options = [];

        if ($visibility = array_get($config, 'visibility')) {
            $options['visibility'] = $visibility;
        }

        if ($pirate = array_get($config, 'pirate')) {
            $options['disable_asserts'] = $pirate;
        }

        return $options;
    }
499506
protected function getTargets(array $config)
    {
        if (!isset($config['targets'])
            || !is_array($config['targets'])
            || array_filter($config['targets'], 'is_array') != $config['targets']) {
            throw new \DomainException(
                'targets must be an array of arrays',
                self::ERR_TARGETS_INVALID
            );
        }
        return $config['targets'];
    }
966032
protected function parseConfig(string $config): array
    {
        $config = json_decode($config, true);
        if ($config === null) {
            throw new ConfigFileFormatException("Config files should be written in valid JSON");
        }
        return $config;
    }
1157305
public static function getMessage(array $config = []): Message
    {
        $message = Message::class;
        $msgConf = $config['message'] ?? [];
        if (!empty($config['message']['instance'])) {
            $message = $config['message']['instance'];
            unset($config['message']['instance']);
        }
        $message = new $message($msgConf);

        return $message;
    }
347353
public function getRepeaterMapping(array $config)
    {
        $mapping = ['data' => null];
        $mapping['data'] = $this->setRepeaters(null, null, $config);

        return $mapping;
    }
388271
private function generateArray(array $config)
    {
        ++$this->indent;

        foreach ($config as $key => $value) {
            if (is_null($value)) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => %s,", $key, 'null'));
                } else {
                    $this->writeLine(sprintf('%s,', 'null'));
                }
            } elseif (is_bool($value)) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => %s,", $key, $value ? 'true' : 'false'));
                } else {
                    $this->writeLine(sprintf('%s,', $value ? 'true' : 'false'));
                }
            } elseif (is_string($value)) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => '%s',", $key, $value));
                } else {
                    $this->writeLine(sprintf("'%s',", $value));
                }
            } elseif (is_array($value)) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => [", $key));
                } else {
                    $this->writeLine('[');
                }

                $this->generateArray($value);

                $this->writeLine('],');
            } elseif ($value instanceof ClassName) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => %s,", $key, (string) $value));
                } else {
                    $this->writeLine(sprintf('%s,', (string) $value));
                }
            } else {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => %s,", $key, $value));
                } else {
                    $this->writeLine($value.',');
                }
            }
        }

        --$this->indent;
    }
945210
public function setConfig(array $config)
    {
        foreach ($config as $key => $value) {
            $this->_config[$key] = $value;
        }

        return $this;
    }
496436
protected function parseConfig(array $config): array
    {
        $result = [];
        foreach ($config as $key => $type) {
            if (\is_array($type)) {
                if ($arrayOfType = $this->factory->checkArrayOfType($type)) {
                    $result[$key] = $arrayOfType;
                } else {
                    $result[$key] = new self($type, $this->factory, $this->strict);
                }
            } elseif ($type instanceof CastInterface) {
                $result[$key] = $type;
            } else {
                $result[$key] = $this->factory->createType($type);
            }
        }

        return $result;
    }