function ConfigCommand::handleMultiValue
Parameters
array{callable, callable} $callbacks Validator and normalizer callbacks:
array<string> $values:
1 call to ConfigCommand::handleMultiValue()
- ConfigCommand::execute in vendor/
composer/ composer/ src/ Composer/ Command/ ConfigCommand.php
File
-
vendor/
composer/ composer/ src/ Composer/ Command/ ConfigCommand.php, line 933
Class
- ConfigCommand
- @author Joshua Estes <Joshua.Estes@iostudio.com> @author Jordi Boggiano <j.boggiano@seld.be>
Namespace
Composer\CommandCode
protected function handleMultiValue(string $key, array $callbacks, array $values, string $method) : void {
[
$validator,
$normalizer,
] = $callbacks;
if (true !== ($validation = $validator($values))) {
throw new \RuntimeException(sprintf('%s is an invalid value' . ($validation ? ' (' . $validation . ')' : ''), json_encode($values)));
}
call_user_func([
$this->configSource,
$method,
], $key, $normalizer($values));
}