class DrupalPinnedDevDependenciesBuilder in Drupal 9
Same name and namespace in other branches
- 8 composer/Generator/Builder/DrupalPinnedDevDependenciesBuilder.php \Drupal\Composer\Generator\Builder\DrupalPinnedDevDependenciesBuilder
Builder to produce metapackage for drupal/core-dev-pinned.
Hierarchy
- class \Drupal\Composer\Generator\Builder\DrupalPackageBuilder implements BuilderInterface
- class \Drupal\Composer\Generator\Builder\DrupalPinnedDevDependenciesBuilder
Expanded class hierarchy of DrupalPinnedDevDependenciesBuilder
3 files declare their use of DrupalPinnedDevDependenciesBuilder
- BuilderTest.php in core/
tests/ Drupal/ Tests/ Composer/ Generator/ BuilderTest.php - MetapackageUpdateTest.php in core/
tests/ Drupal/ Tests/ Composer/ Generator/ MetapackageUpdateTest.php - PackageGenerator.php in composer/
Generator/ PackageGenerator.php
File
- composer/
Generator/ Builder/ DrupalPinnedDevDependenciesBuilder.php, line 10
Namespace
Drupal\Composer\Generator\BuilderView source
class DrupalPinnedDevDependenciesBuilder extends DrupalPackageBuilder {
/**
* {@inheritdoc}
*/
public function getPath() {
return 'PinnedDevDependencies';
}
/**
* {@inheritdoc}
*/
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;
}
/**
* Returns the initial package metadata that describes the metapackage.
*
* @return array
*/
protected function initialPackageMetadata() {
return [
"name" => "drupal/core-dev-pinned",
"type" => "metapackage",
"description" => "Pinned require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.",
"license" => "GPL-2.0-or-later",
"conflict" => [
"webflo/drupal-core-require-dev" => "*",
],
"require" => [
"drupal/core" => Composer::drupalVersionBranch(),
],
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DrupalPackageBuilder:: |
protected | property | Information about composer.json, composer.lock etc. in current release. | |
DrupalPackageBuilder:: |
public | function |
DrupalPackageBuilder constructor. Overrides BuilderInterface:: |
|
DrupalPinnedDevDependenciesBuilder:: |
public | function |
Generate the Composer.json data for the current tag or branch. Overrides BuilderInterface:: |
|
DrupalPinnedDevDependenciesBuilder:: |
public | function |
Return the path to where the metapackage should be written. Overrides BuilderInterface:: |
|
DrupalPinnedDevDependenciesBuilder:: |
protected | function | Returns the initial package metadata that describes the metapackage. |