function ConfigCommand::flattenSettingKeys
build a flat list of dot-separated setting-keys from given config
Parameters
array<mixed[]|string> $config:
Return value
string[]
1 call to ConfigCommand::flattenSettingKeys()
- ConfigCommand::suggestSettingKeys in vendor/
composer/ composer/ src/ Composer/ Command/ ConfigCommand.php - Suggest setting-keys, while taking given options in account.
File
-
vendor/
composer/ composer/ src/ Composer/ Command/ ConfigCommand.php, line 1121
Class
- ConfigCommand
- @author Joshua Estes <Joshua.Estes@iostudio.com> @author Jordi Boggiano <j.boggiano@seld.be>
Namespace
Composer\CommandCode
private function flattenSettingKeys(array $config, string $prefix = '') : array {
$keys = [];
foreach ($config as $key => $value) {
$keys[] = [
$prefix . $key,
];
// array-lists must not be added to completion
// sub-keys of repository-keys must not be added to completion
if (is_array($value) && !array_is_list($value) && $prefix !== 'repositories.') {
$keys[] = $this->flattenSettingKeys($value, $prefix . $key . '.');
}
}
return array_merge(...$keys);
}