You are here

class Plugin in Database Sanitize 7

Composer plugin to merge yaml files.

Hierarchy

  • class \EdisonLabs\MergeYaml\Plugin implements \Composer\Plugin\PluginInterface, \Composer\EventDispatcher\EventSubscriberInterface, \Composer\Plugin\Capable

Expanded class hierarchy of Plugin

1 file declares its use of Plugin
PluginTest.php in vendor/edisonlabs/merge-yaml/tests/src/Unit/PluginTest.php

File

vendor/edisonlabs/merge-yaml/src/Plugin.php, line 16

Namespace

EdisonLabs\MergeYaml
View source
class Plugin implements PluginInterface, EventSubscriberInterface, Capable {

  /**
   * The Plugin handler object.
   *
   * @var \EdisonLabs\MergeYaml\PluginHandler
   */
  protected $pluginHandler;

  /**
   * {@inheritdoc}
   */
  public function activate(Composer $composer, IOInterface $io) {
    $this->pluginHandler = new PluginHandler($composer, $io);
  }

  /**
   * {@inheritdoc}
   */
  public function getCapabilities() {
    return array(
      'Composer\\Plugin\\Capability\\CommandProvider' => 'EdisonLabs\\MergeYaml\\CommandProvider',
    );
  }

  /**
   * {@inheritdoc}
   */
  public static function getSubscribedEvents() {
    return array(
      ScriptEvents::POST_INSTALL_CMD => array(
        'postCmd',
        -1,
      ),
      ScriptEvents::POST_UPDATE_CMD => array(
        'postCmd',
        -1,
      ),
    );
  }

  /**
   * Post command event callback.
   *
   * @param \Composer\Script\Event $event
   *   Event object.
   */
  public function postCmd(Event $event) {
    $this->pluginHandler
      ->createMergeFiles();
  }

  /**
   * Gets the plugin handler.
   *
   * @return \EdisonLabs\MergeYaml\PluginHandler
   *   The MergeYaml plugin handler.
   */
  public function getPluginHandler() {
    return $this->pluginHandler;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Plugin::$pluginHandler protected property The Plugin handler object.
Plugin::activate public function
Plugin::getCapabilities public function
Plugin::getPluginHandler public function Gets the plugin handler.
Plugin::getSubscribedEvents public static function
Plugin::postCmd public function Post command event callback.