You are here

class CommandConfigureEvent in Update helper 8

Event for command configure.

@package Drupal\update_helper\Events

Hierarchy

  • class \Drupal\update_helper\Events\CommandConfigureEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of CommandConfigureEvent

2 files declare their use of CommandConfigureEvent
CommandGcuSubscriber.php in modules/update_helper_checklist/src/Events/CommandGcuSubscriber.php
GenerateConfigurationUpdateCommand.php in src/Command/GenerateConfigurationUpdateCommand.php

File

src/Events/CommandConfigureEvent.php, line 13

Namespace

Drupal\update_helper\Events
View source
class CommandConfigureEvent extends Event {

  /**
   * Console command for this event.
   *
   * @var \Drupal\Console\Core\Command\Command
   */
  protected $command;

  /**
   * CommandOptionsEvent constructor.
   *
   * @param \Drupal\Console\Core\Command\Command $command
   *   Command that for which this event is triggered.
   */
  public function __construct(Command $command) {
    $this->command = $command;
  }

  /**
   * Command that for what this event is triggered.
   *
   * @return \Drupal\Console\Core\Command\Command
   *   Returns command.
   */
  public function getCommand() {
    return $this->command;
  }

  /**
   * Add option to command.
   *
   * @param string $name
   *   The option name.
   * @param string $shortcut
   *   The shortcut (can be null).
   * @param int $mode
   *   The option mode: One of the InputOption::VALUE_* constants.
   * @param string $description
   *   A description text.
   * @param mixed $default
   *   The default value (must be null for InputOption::VALUE_NONE).
   */
  public function addOption($name, $shortcut = NULL, $mode = NULL, $description = '', $default = NULL) {
    $this->command
      ->addOption($name, $shortcut, $mode, $description, $default);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CommandConfigureEvent::$command protected property Console command for this event.
CommandConfigureEvent::addOption public function Add option to command.
CommandConfigureEvent::getCommand public function Command that for what this event is triggered.
CommandConfigureEvent::__construct public function CommandOptionsEvent constructor.