function AllowedPackages::event
Same name in other branches
- 9 composer/Plugin/Scaffold/AllowedPackages.php \Drupal\Composer\Plugin\Scaffold\AllowedPackages::event()
- 8.9.x composer/Plugin/Scaffold/AllowedPackages.php \Drupal\Composer\Plugin\Scaffold\AllowedPackages::event()
- 11.x composer/Plugin/Scaffold/AllowedPackages.php \Drupal\Composer\Plugin\Scaffold\AllowedPackages::event()
Overrides PostPackageEventListenerInterface::event
File
-
composer/
Plugin/ Scaffold/ AllowedPackages.php, line 97
Class
- AllowedPackages
- Determine recursively which packages have been allowed to scaffold files.
Namespace
Drupal\Composer\Plugin\ScaffoldCode
public function event(PackageEvent $event) {
$operation = $event->getOperation();
// Determine the package. Later, in evaluateNewPackages(), we will report
// which of the newly-installed packages have scaffold operations, and
// whether or not they are allowed to scaffold by the allowed-packages
// option in the root-level composer.json file.
$package = $operation->getOperationType() === 'update' ? $operation->getTargetPackage() : $operation->getPackage();
if (ScaffoldOptions::hasOptions($package->getExtra())) {
$this->newPackages[$package->getName()] = $package;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.