class DrupalDevDependenciesBuilder
Same name in other branches
- 9 composer/Generator/Builder/DrupalDevDependenciesBuilder.php \Drupal\Composer\Generator\Builder\DrupalDevDependenciesBuilder
- 8.9.x composer/Generator/Builder/DrupalDevDependenciesBuilder.php \Drupal\Composer\Generator\Builder\DrupalDevDependenciesBuilder
- 11.x 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 \Drupal\Composer\Generator\BuilderInterface
- class \Drupal\Composer\Generator\Builder\DrupalDevDependenciesBuilder extends \Drupal\Composer\Generator\Builder\DrupalPackageBuilder
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
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
DrupalDevDependenciesBuilder::getPackage | public | function | Generate the Composer.json data for the current tag or branch. | Overrides BuilderInterface::getPackage |
DrupalDevDependenciesBuilder::getPath | public | function | Return the path to where the metapackage should be written. | Overrides BuilderInterface::getPath |
DrupalDevDependenciesBuilder::initialPackageMetadata | protected | function | Returns the initial package metadata that describes the metapackage. | |
DrupalPackageBuilder::$drupalCoreInfo | protected | property | Information about composer.json, composer.lock etc. in current release. | |
DrupalPackageBuilder::__construct | public | function | DrupalPackageBuilder constructor. | Overrides BuilderInterface::__construct |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.