You are here

protected function Plugin::handler in Drupal 9

Same name and namespace in other branches
  1. 8 composer/Plugin/Scaffold/Plugin.php \Drupal\Composer\Plugin\Scaffold\Plugin::handler()

Lazy-instantiate the handler object. It is dangerous to update a Composer plugin if it loads any classes prior to the `composer update` operation, and later tries to use them in a post-update hook.

File

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

Class

Plugin
Composer plugin for handling drupal scaffold.

Namespace

Drupal\Composer\Plugin\Scaffold

Code

protected function handler() {
  if (!$this->handler) {
    $this->handler = new Handler($this->composer, $this->io);

    // On instantiation of our handler, notify it if the 'require' command
    // was executed.
    if ($this->requireWasCalled) {
      $this->handler
        ->requireWasCalled();
    }
  }
  return $this->handler;
}