Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BaseCommand.php

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\Command

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal