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

Breadcrumb

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

function AuditCommand::getPackages

Return value

PackageInterface[]

1 call to AuditCommand::getPackages()
AuditCommand::execute in vendor/composer/composer/src/Composer/Command/AuditCommand.php
Executes the current command.

File

vendor/composer/composer/src/Composer/Command/AuditCommand.php, line 95

Class

AuditCommand

Namespace

Composer\Command

Code

private function getPackages(Composer $composer, InputInterface $input) : array {
    if ($input->getOption('locked')) {
        if (!$composer->getLocker()
            ->isLocked()) {
            throw new \UnexpectedValueException('Valid composer.json and composer.lock files are required to run this command with --locked');
        }
        $locker = $composer->getLocker();
        return $locker->getLockedRepository(!$input->getOption('no-dev'))
            ->getPackages();
    }
    $rootPkg = $composer->getPackage();
    $installedRepo = new InstalledRepository([
        $composer->getRepositoryManager()
            ->getLocalRepository(),
    ]);
    if ($input->getOption('no-dev')) {
        return RepositoryUtils::filterRequiredPackages($installedRepo->getPackages(), $rootPkg);
    }
    return $installedRepo->getPackages();
}

API Navigation

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