function BaseCommand::getAuditFormat
@internal
Parameters
'format'|'audit-format' $optName:
Return value
Auditor::FORMAT_*
3 calls to BaseCommand::getAuditFormat()
- AuditCommand::execute in vendor/
composer/ composer/ src/ Composer/ Command/ AuditCommand.php - Executes the current command.
- CreateProjectCommand::installProject in vendor/
composer/ composer/ src/ Composer/ Command/ CreateProjectCommand.php - InstallCommand::execute in vendor/
composer/ composer/ src/ Composer/ Command/ InstallCommand.php - Executes the current command.
File
-
vendor/
composer/ composer/ src/ Composer/ Command/ BaseCommand.php, line 456
Class
- BaseCommand
- Base class for Composer commands
Namespace
Composer\CommandCode
protected function getAuditFormat(InputInterface $input, string $optName = 'audit-format') : string {
if (!$input->hasOption($optName)) {
throw new \LogicException('This should not be called on a Command which has no ' . $optName . ' option defined.');
}
$val = $input->getOption($optName);
if (!in_array($val, Auditor::FORMATS, true)) {
throw new \InvalidArgumentException('--' . $optName . ' must be one of ' . implode(', ', Auditor::FORMATS) . '.');
}
return $val;
}