Skip to content

Commit 21cf52b

Browse files
Pass the entire Composer event to the downloadScaffold method.
1 parent ee07826 commit 21cf52b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Handler.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function onPostCmdEvent(Event $event) {
112112
// Only install the scaffolding if drupal/core was installed,
113113
// AND there are no scaffolding files present.
114114
if (isset($this->drupalCorePackage)) {
115-
$this->downloadScaffold($event->isDevMode());
115+
$this->downloadScaffold($event);
116116
// Generate the autoload.php file after generating the scaffold files.
117117
$this->generateAutoload();
118118
}
@@ -121,18 +121,18 @@ public function onPostCmdEvent(Event $event) {
121121
/**
122122
* Downloads drupal scaffold files for the current process.
123123
*
124-
* @param bool $dev
125-
* TRUE if dev packages are installed. FALSE otherwise.
124+
* @param \Composer\Script\Event $event
125+
* The Composer event.
126126
*/
127-
public function downloadScaffold($dev = FALSE) {
127+
public function downloadScaffold($event) {
128128
$drupalCorePackage = $this->getDrupalCorePackage();
129129
$webroot = realpath($this->getWebRoot());
130130

131131
// Collect options, excludes, dev and settings files.
132132
$options = $this->getOptions();
133133
$includes = $this->getIncludes();
134134
// Check dev files if necessary.
135-
if ($dev) {
135+
if ($event->isDevMode()) {
136136
$includes = array_merge($includes, $this->getIncludesDev());
137137
}
138138
$files = array_diff($includes, $this->getExcludes());

src/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function postCmd(Event $event) {
9595
public static function scaffold(Event $event) {
9696
@trigger_error('\DrupalComposer\DrupalScaffold\Plugin::scaffold is deprecated since version 2.5.0 and will be removed in 3.0. Use "composer drupal:scaffold" instead.', E_USER_DEPRECATED);
9797
$handler = new Handler($event->getComposer(), $event->getIO());
98-
$handler->downloadScaffold($event->isDevMode());
98+
$handler->downloadScaffold($event);
9999
// Generate the autoload.php file after generating the scaffold files.
100100
$handler->generateAutoload();
101101
}

0 commit comments

Comments
 (0)