function Unpacker::getPackageFromLinkTarget

Gets the package object from a link's target.

Parameters

\Composer\Package\Link $dependency: The link dependency.

Return value

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

1 call to Unpacker::getPackageFromLinkTarget()
Unpacker::processPackageDependencies in composer/Plugin/RecipeUnpack/Unpacker.php
Processes dependencies of the package that is being unpacked.

File

composer/Plugin/RecipeUnpack/Unpacker.php, line 211

Class

Unpacker
Handles the details of unpacking a specific recipe.

Namespace

Drupal\Composer\Plugin\RecipeUnpack

Code

private function getPackageFromLinkTarget(Link $dependency) : ?PackageInterface {
    return $this->composer
        ->getRepositoryManager()
        ->getLocalRepository()
        ->findPackage($dependency->getTarget(), $dependency->getConstraint());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.