class ComposerPluginImplementsScaffoldEvents

Same name in other branches
  1. 11.x core/tests/Drupal/Tests/Composer/Plugin/Scaffold/fixtures/composer-plugin-implements-scaffold-events/src/ComposerPluginImplementsScaffoldEvents.php \Drupal\Tests\fixture\Composer\Plugin\ComposerPluginImplementsScaffoldEvents

A fixture composer plugin implement Drupal scaffold events.

Hierarchy

Expanded class hierarchy of ComposerPluginImplementsScaffoldEvents

File

core/tests/Drupal/Tests/Composer/Plugin/Scaffold/fixtures/composer-plugin-implements-scaffold-events/src/ComposerPluginImplementsScaffoldEvents.php, line 17

Namespace

Drupal\Tests\fixture\Composer\Plugin
View source
class ComposerPluginImplementsScaffoldEvents implements PluginInterface, EventSubscriberInterface {
    
    /**
     * {@inheritdoc}
     */
    public static function getSubscribedEvents() : array {
        return [
            Handler::PRE_DRUPAL_SCAFFOLD_CMD => 'preDrupalScaffoldCmd',
            Handler::POST_DRUPAL_SCAFFOLD_CMD => 'postDrupalScaffoldCmd',
        ];
    }
    
    /**
     * Implements pre Drupal scaffold cmd.
     */
    public static function preDrupalScaffoldCmd(Event $event) : void {
        $event->getIO()
            ->write('Hello preDrupalScaffoldCmd');
    }
    
    /**
     * Implements post Drupal scaffold cmd.
     */
    public static function postDrupalScaffoldCmd(Event $event) : void {
        $event->getIO()
            ->write('Hello postDrupalScaffoldCmd');
    }
    
    /**
     * {@inheritdoc}
     */
    public function activate(Composer $composer, IOInterface $io) : void {
    }
    
    /**
     * {@inheritdoc}
     */
    public function deactivate(Composer $composer, IOInterface $io) : void {
    }
    
    /**
     * {@inheritdoc}
     */
    public function uninstall(Composer $composer, IOInterface $io) : void {
    }

}

Members


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.