You are here

protected function AllowedPackages::getTopLevelAllowedPackages in Drupal 8

Same name and namespace in other branches
  1. 9 composer/Plugin/Scaffold/AllowedPackages.php \Drupal\Composer\Plugin\Scaffold\AllowedPackages::getTopLevelAllowedPackages()

Gets all packages that are allowed in the top-level composer.json.

We will implicitly allow the projects 'drupal/legacy-scaffold-assets' and 'drupal/core' to scaffold files, if they are present. Any other project must be explicitly whitelisted in the top-level composer.json file in order to be allowed to override scaffold files.

Return value

array An array of allowed Composer package names.

1 call to AllowedPackages::getTopLevelAllowedPackages()
AllowedPackages::getAllowedPackages in composer/Plugin/Scaffold/AllowedPackages.php
Gets a list of all packages that are allowed to copy scaffold files.

File

composer/Plugin/Scaffold/AllowedPackages.php, line 122

Class

AllowedPackages
Determine recursively which packages have been allowed to scaffold files.

Namespace

Drupal\Composer\Plugin\Scaffold

Code

protected function getTopLevelAllowedPackages() {
  $implicit_packages = [
    'drupal/legacy-scaffold-assets',
    'drupal/core',
  ];
  $top_level_packages = $this->manageOptions
    ->getOptions()
    ->allowedPackages();
  return array_merge($implicit_packages, $top_level_packages);
}