function DrupalPinnedDevDependenciesBuilder::getPackage

Same name in other branches
  1. 9 composer/Generator/Builder/DrupalPinnedDevDependenciesBuilder.php \Drupal\Composer\Generator\Builder\DrupalPinnedDevDependenciesBuilder::getPackage()
  2. 10 composer/Generator/Builder/DrupalPinnedDevDependenciesBuilder.php \Drupal\Composer\Generator\Builder\DrupalPinnedDevDependenciesBuilder::getPackage()
  3. 11.x composer/Generator/Builder/DrupalPinnedDevDependenciesBuilder.php \Drupal\Composer\Generator\Builder\DrupalPinnedDevDependenciesBuilder::getPackage()

Overrides BuilderInterface::getPackage

File

composer/Generator/Builder/DrupalPinnedDevDependenciesBuilder.php, line 22

Class

DrupalPinnedDevDependenciesBuilder
Builder to produce metapackage for drupal/core-dev-pinned.

Namespace

Drupal\Composer\Generator\Builder

Code

public function getPackage() {
    $composer = $this->initialPackageMetadata();
    // Pull the exact versions of the dependencies from the composer.lock
    // file and use it to build our 'require' section.
    $composerLockData = $this->drupalCoreInfo
        ->composerLock();
    if (isset($composerLockData['packages-dev'])) {
        foreach ($composerLockData['packages-dev'] as $package) {
            $composer['require'][$package['name']] = $package['version'];
        }
    }
    return $composer;
}

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