Issue #3266160 by smustgrave, alex.skrypnyk, tannguyenhn, beatrizrodrigues, joachim, larowlan: Composer Scaffold plugin calls dispatch() instead of dispatchScript()

merge-requests/8036/head
Alex Pott 2024-05-11 09:21:21 +01:00
parent b41dfccbae
commit a61eee36d2
No known key found for this signature in database
GPG Key ID: BDA67E7EE836E5CE
2 changed files with 5 additions and 5 deletions

View File

@ -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);
}
/**

View File

@ -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');
}
/**