You are here

protected function AllowedPackages::getPackage in Drupal 9

Same name and namespace in other branches
  1. 8 composer/Plugin/Scaffold/AllowedPackages.php \Drupal\Composer\Plugin\Scaffold\AllowedPackages::getPackage()

Retrieves a package from the current composer process.

Parameters

string $name: Name of the package to get from the current composer installation.

Return value

\Composer\Package\PackageInterface|null The Composer package.

1 call to AllowedPackages::getPackage()
AllowedPackages::recursiveGetAllowedPackages in composer/Plugin/Scaffold/AllowedPackages.php
Builds a name-to-package mapping from a list of package names.

File

composer/Plugin/Scaffold/AllowedPackages.php, line 213

Class

AllowedPackages
Determine recursively which packages have been allowed to scaffold files.

Namespace

Drupal\Composer\Plugin\Scaffold

Code

protected function getPackage($name) {
  return $this->composer
    ->getRepositoryManager()
    ->getLocalRepository()
    ->findPackage($name, '*');
}