Issue #3266160 by smustgrave, alex.skrypnyk, tannguyenhn, beatrizrodrigues, joachim, larowlan: Composer Scaffold plugin calls dispatch() instead of dispatchScript()
parent
b41dfccbae
commit
a61eee36d2
|
@ -143,7 +143,7 @@ class Handler {
|
|||
|
||||
// Call any pre-scaffold scripts that may be defined.
|
||||
$dispatcher = $this->composer->getEventDispatcher();
|
||||
$dispatcher->dispatch(self::PRE_DRUPAL_SCAFFOLD_CMD);
|
||||
$dispatcher->dispatchScript(self::PRE_DRUPAL_SCAFFOLD_CMD);
|
||||
|
||||
// Fetch the list of file mappings from each allowed package and normalize
|
||||
// them.
|
||||
|
@ -178,7 +178,7 @@ class Handler {
|
|||
$gitIgnoreManager->manageIgnored($scaffold_results, $scaffold_options);
|
||||
|
||||
// Call post-scaffold scripts.
|
||||
$dispatcher->dispatch(self::POST_DRUPAL_SCAFFOLD_CMD);
|
||||
$dispatcher->dispatchScript(self::POST_DRUPAL_SCAFFOLD_CMD);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,11 +4,11 @@ declare(strict_types = 1);
|
|||
|
||||
namespace Drupal\Tests\fixture\Composer\Plugin;
|
||||
|
||||
use Composer\EventDispatcher\Event;
|
||||
use Composer\EventDispatcher\EventSubscriberInterface;
|
||||
use Composer\Plugin\PluginInterface;
|
||||
use Composer\Composer;
|
||||
use Composer\IO\IOInterface;
|
||||
use Composer\Script\Event;
|
||||
use Drupal\Composer\Plugin\Scaffold\Handler;
|
||||
|
||||
/**
|
||||
|
@ -30,14 +30,14 @@ class ComposerPluginImplementsScaffoldEvents implements PluginInterface, EventSu
|
|||
* Implements pre Drupal scaffold cmd.
|
||||
*/
|
||||
public static function preDrupalScaffoldCmd(Event $event): void {
|
||||
print 'Hello preDrupalScaffoldCmd' . PHP_EOL;
|
||||
$event->getIO()->write('Hello preDrupalScaffoldCmd');
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements post Drupal scaffold cmd.
|
||||
*/
|
||||
public static function postDrupalScaffoldCmd(Event $event): void {
|
||||
print 'Hello postDrupalScaffoldCmd' . PHP_EOL;
|
||||
$event->getIO()->write('Hello postDrupalScaffoldCmd');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue