function Plugin::handler

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

Instantiates the handler object upon demand.

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 137

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;
}

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