function VendorHardeningPlugin::onPostPackageInstall

Same name in other branches
  1. 9 composer/Plugin/VendorHardening/VendorHardeningPlugin.php \Drupal\Composer\Plugin\VendorHardening\VendorHardeningPlugin::onPostPackageInstall()
  2. 10 composer/Plugin/VendorHardening/VendorHardeningPlugin.php \Drupal\Composer\Plugin\VendorHardening\VendorHardeningPlugin::onPostPackageInstall()
  3. 11.x composer/Plugin/VendorHardening/VendorHardeningPlugin.php \Drupal\Composer\Plugin\VendorHardening\VendorHardeningPlugin::onPostPackageInstall()

POST_PACKAGE_INSTALL event handler.

Parameters

\Composer\Installer\PackageEvent $event:

File

composer/Plugin/VendorHardening/VendorHardeningPlugin.php, line 142

Class

VendorHardeningPlugin
A Composer plugin to clean out your project's vendor directory.

Namespace

Drupal\Composer\Plugin\VendorHardening

Code

public function onPostPackageInstall(PackageEvent $event) {
    
    /** @var \Composer\Package\CompletePackage $package */
    $package = $event->getOperation()
        ->getPackage();
    $package_name = $package->getName();
    $this->cleanPackage($this->composer
        ->getConfig()
        ->get('vendor-dir'), $package_name);
}

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