diff --git a/src/Handler.php b/src/Handler.php index f461da8..beffa62 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -88,7 +88,7 @@ public function onPostCmdEvent(\Composer\Script\Event $event) { // Only install the scaffolding if drupal/core was installed, // AND there are no scaffolding files present. if (isset($this->drupalCorePackage)) { - $this->downloadScaffold($event->isDevMode()); + $this->downloadScaffold($event); // Generate the autoload.php file after generating the scaffold files. $this->generateAutoload(); } @@ -97,10 +97,10 @@ public function onPostCmdEvent(\Composer\Script\Event $event) { /** * Downloads drupal scaffold files for the current process. * - * @param bool $dev - * TRUE if dev packages are installed. FALSE otherwise. + * @param \Composer\Script\Event $event + * The Composer event. */ - public function downloadScaffold($dev = FALSE) { + public function downloadScaffold($event) { $drupalCorePackage = $this->getDrupalCorePackage(); $webroot = realpath($this->getWebRoot()); @@ -108,7 +108,7 @@ public function downloadScaffold($dev = FALSE) { $options = $this->getOptions(); $includes = $this->getIncludes(); // Check dev files if necessary. - if ($dev) { + if ($event->isDevMode()) { $includes = array_merge($includes, $this->getIncludesDev()); } $files = array_diff($includes, $this->getExcludes()); diff --git a/src/Plugin.php b/src/Plugin.php index 7b863e8..9f06cc0 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -74,7 +74,7 @@ public function postCmd(\Composer\Script\Event $event) { */ public static function scaffold(\Composer\Script\Event $event) { $handler = new Handler($event->getComposer(), $event->getIO()); - $handler->downloadScaffold($event->isDevMode()); + $handler->downloadScaffold($event); // Generate the autoload.php file after generating the scaffold files. $handler->generateAutoload(); }