function Plugin::onCommand

Same name in other branches
  1. 9 composer/Plugin/Scaffold/Plugin.php \Drupal\Composer\Plugin\Scaffold\Plugin::onCommand()
  2. 10 composer/Plugin/Scaffold/Plugin.php \Drupal\Composer\Plugin\Scaffold\Plugin::onCommand()
  3. 11.x composer/Plugin/Scaffold/Plugin.php \Drupal\Composer\Plugin\Scaffold\Plugin::onCommand()

Pre command event callback.

Parameters

\Composer\Plugin\CommandEvent $event: The Composer command event.

File

composer/Plugin/Scaffold/Plugin.php, line 121

Class

Plugin
Composer plugin for handling drupal scaffold.

Namespace

Drupal\Composer\Plugin\Scaffold

Code

public function onCommand(CommandEvent $event) {
    if ($event->getCommandName() == 'require') {
        if ($this->handler) {
            throw new \Error('Core Scaffold Plugin handler instantiated too early. See https://www.drupal.org/project/drupal/issues/3104922');
        }
        $this->requireWasCalled = TRUE;
    }
}

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