<?php namespace LakeDrops\Behat4Drupal; use Composer\Script\Event; use Composer\Script\ScriptEvents; use LakeDrops\Component\Composer\BasePlugin; /** * Composer plugin for handling drupal scaffold. */ class Plugin extends BasePlugin { /** * {@inheritdoc} */ public function getHandlerClass() { return Handler::class; } /** * {@inheritdoc} */ public function getCapabilities(): array { return [ \Composer\Plugin\Capability\CommandProvider::class => CommandProvider::class, ]; } /** * {@inheritdoc} */ public static function getSubscribedEvents(): array { return [ ScriptEvents::POST_CREATE_PROJECT_CMD => 'postCreateProject', ]; } /** * Post create project event callback. * * @param \Composer\Script\Event $event * The event that triggered the plugin. * * @throws \Twig_Error_Loader * @throws \Twig_Error_Runtime * @throws \Twig_Error_Syntax */ public function postCreateProject(Event $event) { /** @var Handler $handler */ $handler = $this->handler; $handler ->setEvent($event) ->configureProject(); } }