Transforms configuration string into an array

@param string $config
@return array
559890
public function transform(string $config = ''): array
    {
        $parsed = [];
        if (!empty($config)) {
            $config = \parse_ini_string($config, true, INI_SCANNER_RAW);
            if (\is_array($config)) {
                $parsed = $this->processNode($config);
            }
        }
        return $parsed;
    }
47616
public function parseConfiguration($config)
    {
        if (is_string($config)) {
            $config = ['url' => $config];
        }

        $url = $config['url'] ?? null;

        $config = Arr::except($config, 'url');

        if (! $url) {
            return $config;
        }

        $parsedUrl = $this->parseUrl($url);

        return array_merge(
            $config,
            $this->getPrimaryOptions($parsedUrl),
            $this->getQueryOptions($parsedUrl)
        );
    }
407487
public function transform(string $config = ''): array
    {
        $parsed = [];

        if (!\extension_loaded('php_yaml')) {
            return $parsed;
        }
        if (!empty($config)) {
            $parsed = \yaml_parse($config);
            $parsed = $parsed !== null ? $parsed : [];
        }

        return $parsed;
    }
395944
public static function invoke(
        array $fieldsConfig
    ): array {
        $fieldsConfigByName = [];
        foreach ($fieldsConfig as $fieldConfig) {
            $name = Property::getRequired(
                $fieldConfig,
                FieldConfig::NAME
            );
            $fieldsConfigByName[$name] = $fieldConfig;
        }

        return $fieldsConfigByName;
    }
357244
public function parseString($config)
    {
        try {
            $data = YamlParser::parse($config, YamlParser::PARSE_CONSTANT);
        } catch (Exception $exception) {
            throw new ParseException(
                [
                    'message'   => 'Error parsing YAML string',
                    'exception' => $exception,
                ]
            );
        }

        return (array)$this->parse($data);
    }
1179842
private function getConfigsForUriTemplates($config)
    {
        $configs = [$config];

        if ($config['additionalBindings']) {
            foreach ($config['additionalBindings'] as $additionalBinding) {
                $configs[] = $additionalBinding + $config;
            }
        }

        return $configs;
    }
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;
    }
915688
private function extractGuzzleConfig($config)
    {
        foreach (ConfigUtils::$GUZZLE_CONFIG_KEYS as $guzzleOption) {
            if (array_key_exists($guzzleOption, $config)) {
                $this->guzzleConfig[$guzzleOption] = $config[$guzzleOption];
                unset($config[$guzzleOption]);
            }
        }

        return $config;
    }
1127474
public function transform(array $config): string
    {
        $cfg = '';
        foreach ($config as $nodeName => $nodeData) {
            $nodeName = \is_numeric($nodeName) ? 'num__'.$nodeName : $nodeName;

            if (\is_array($nodeData)) {
                $cfg .= \sprintf('%s[%s]%s', \chr($this->newline), $nodeName, \chr($this->newline));
                $cfg .= $this->addLine($nodeName, $nodeData, 0);
            } elseif (\is_bool($nodeData)) {
                $nodeData = $nodeData === true ? 'true' : 'false';
                $cfg .= \sprintf('%s = %s%s', $nodeName, $nodeData, \chr($this->newline));
            } else {
                $nodeData = $this->normalize((string)$nodeData);
                $cfg .= \sprintf('%s = %s%s', $nodeName, $nodeData, \chr($this->newline));
            }
        }
        return $cfg;
    }
393555
public function transform(array $config): string
    {
        $writer = new \XMLWriter();
        $writer->openMemory();
        $writer->setIndent(true);
        $writer->setIndentString(\str_repeat(' ', 4));
        $writer->startDocument('1.0', 'UTF-8');
        $writer->startElement('config');

        foreach ($config as $nodeName => $nodeData) {
            $nodeName = \is_numeric($nodeName) ? 'num__'.$nodeName : $nodeName;

            if (\is_array($nodeData)) {
                $this->addChildNode($nodeName, $nodeData, $writer);
            } elseif (\is_bool($nodeData)) {
                $writer->writeElement($nodeName, $nodeData === true ? 'true' : 'false');
            } else {
                $writer->writeElement($nodeName, (string)$nodeData);
            }
        }

        $writer->endElement();
        $writer->endDocument();
        return $writer->outputMemory();
    }
1234909
protected function buildColumns(array $config)
    {
        $columns = [];

        foreach (isset($config['columns']) ? $config['columns'] : [] as $name => $column) {
            $column = $this->buildColumn(array_merge(['name' => $name], $column), $config);
            $columns[$column->getName()] = $column;
        }

        return $columns;
    }
130344
final protected function getConfigs($config = null)
    {
        if (null !== $config) {
            if (array_key_exists($config, self::$_configs)) {
                return self::$_configs[$config];
            } else {
                return false;
            }
        }

        return self::$_configs;
    }
897469
public static function getConfig(array $appConfig = []) : array
  {
    $configs = DEPConfig::$appdir . 'config' . DIRECTORY_SEPARATOR . '*.php';

    foreach (\glob($configs) as $config) {
      $service = require $config;

      if (is_array($service)) {
        $path = basename($config);
        $name = \substr($path, 0, strlen($path) - 4);
        $appConfig = array_merge($appConfig, [$name => $service]);
      }
    }

    return $appConfig;
  }
1258349
private function convertToArray(array $config)
    {
        foreach ($config as $key => &$value) {
            if (is_array($value)) {
                $value = $this->convertToArray($value);

                if (!$value) {
                    unset($config[$key]);
                }
            } elseif ($value instanceof IConfigValue) {
                if ($value->has(IConfigValue::KEY_LOCAL)) {
                    $value = $value->get(IConfigValue::KEY_LOCAL);
                } else {
                    unset($config[$key]);
                }
            } elseif ($value instanceof IConfigSource) {
                unset($config[$key]);
            } else {
                throw new UnexpectedValueException($this->translate(
                    'Config source is corrupted.'
                ));
            }
        }

        return $config;
    }
565416
protected function encodeConfiguration($config = [])
    {
        $value = [];
        ksort($config);
        foreach ($config as $directive => $values) {
            $values = array_unique($values);
            sort($values);
            array_unshift($values, $directive);
            $string = implode($this->sourceSeparator, $values);

            if ($string) {
                $value[] = $string;
            }
        }

        return implode($this->directiveSeparator . ' ', $value);
    }
1110126
protected function iteratoToArray(Traversable $config) {
		$config = iterator_to_array($config);
		
		foreach ($config as &$value) {
			if ($value instanceof Traversable) {
				$value = $this->iteratoToArray($value);
			}
		}
		unset($value);
		
		return $config;
	}
1199914
public function config($config = null) {
		if ($config) {
			if (!is_array($config)) {
				return isset($this->_config[$config]) ? $this->_config[$config] : null;
			}
			$this->_config = $config + $this->_config;
		}
		return $this->_config;
	}