function UnpackManager::isRootDependency

Determines if the provided package is present in the root composer.json.

Parameters

string $package_name: The package name to check.

Return value

bool TRUE if the package is present in the root composer.json, FALSE if not.

File

composer/Plugin/RecipeUnpack/UnpackManager.php, line 77

Class

UnpackManager
Manages the recipe unpacking process.

Namespace

Drupal\Composer\Plugin\RecipeUnpack

Code

public function isRootDependency(string $package_name) : bool {
    $root_package = $this->composer
        ->getPackage();
    return isset($root_package->getRequires()[$package_name]) || isset($root_package->getDevRequires()[$package_name]);
}

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