diff --git a/Handler.php b/Handler.php index 3e51f909a3..a3e9914bb3 100644 --- a/Handler.php +++ b/Handler.php @@ -3,7 +3,6 @@ namespace Drupal\Composer\Plugin\Scaffold; use Composer\Composer; -use Composer\EventDispatcher\EventDispatcher; use Composer\Installer\PackageEvent; use Composer\IO\IOInterface; use Composer\Package\PackageInterface; @@ -143,7 +142,7 @@ public function scaffold() { } // Call any pre-scaffold scripts that may be defined. - $dispatcher = new EventDispatcher($this->composer, $this->io); + $dispatcher = $this->composer->getEventDispatcher(); $dispatcher->dispatch(self::PRE_DRUPAL_SCAFFOLD_CMD); // Fetch the list of file mappings from each allowed package and normalize