class DrupalDevDependenciesBuilder in Drupal 9
Same name and namespace in other branches
- 8 composer/Generator/Builder/DrupalDevDependenciesBuilder.php \Drupal\Composer\Generator\Builder\DrupalDevDependenciesBuilder
Builder to produce metapackage for drupal/core-dev.
Hierarchy
- class \Drupal\Composer\Generator\Builder\DrupalPackageBuilder implements BuilderInterface
- class \Drupal\Composer\Generator\Builder\DrupalDevDependenciesBuilder
Expanded class hierarchy of DrupalDevDependenciesBuilder
3 files declare their use of DrupalDevDependenciesBuilder
- 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/ DrupalDevDependenciesBuilder.php, line 8
Namespace
Drupal\Composer\Generator\BuilderView source
class DrupalDevDependenciesBuilder extends DrupalPackageBuilder {
/**
* {@inheritdoc}
*/
public function getPath() {
return 'DevDependencies';
}
/**
* {@inheritdoc}
*/
public function getPackage() {
$composer = $this
->initialPackageMetadata();
// Put everything from Drupal's "require-dev" into our "require" section.
$composer['require'] = $this->drupalCoreInfo
->getRequireDev();
// Sort our required packages by key.
ksort($composer['require']);
return $composer;
}
/**
* Returns the initial package metadata that describes the metapackage.
*
* @return array
*/
protected function initialPackageMetadata() {
return [
"name" => "drupal/core-dev",
"type" => "metapackage",
"description" => "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" => "*",
],
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DrupalDevDependenciesBuilder:: |
public | function |
Generate the Composer.json data for the current tag or branch. Overrides BuilderInterface:: |
|
DrupalDevDependenciesBuilder:: |
public | function |
Return the path to where the metapackage should be written. Overrides BuilderInterface:: |
|
DrupalDevDependenciesBuilder:: |
protected | function | Returns the initial package metadata that describes the metapackage. | |
DrupalPackageBuilder:: |
protected | property | Information about composer.json, composer.lock etc. in current release. | |
DrupalPackageBuilder:: |
public | function |
DrupalPackageBuilder constructor. Overrides BuilderInterface:: |