function AllowedPackages::getTopLevelAllowedPackages

Same name in other branches
  1. 8.9.x composer/Plugin/Scaffold/AllowedPackages.php \Drupal\Composer\Plugin\Scaffold\AllowedPackages::getTopLevelAllowedPackages()
  2. 10 composer/Plugin/Scaffold/AllowedPackages.php \Drupal\Composer\Plugin\Scaffold\AllowedPackages::getTopLevelAllowedPackages()
  3. 11.x 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);
}

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