Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CommandEvent.php

class CommandEvent

An event for all commands.

@author Nils Adermann <naderman@naderman.de>

Hierarchy

  • class \Composer\EventDispatcher\Event
    • class \Composer\Plugin\CommandEvent extends \Composer\EventDispatcher\Event

Expanded class hierarchy of CommandEvent

16 files declare their use of CommandEvent
ArchiveCommand.php in vendor/composer/composer/src/Composer/Command/ArchiveCommand.php
BaseDependencyCommand.php in vendor/composer/composer/src/Composer/Command/BaseDependencyCommand.php
DiagnoseCommand.php in vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php
DumpAutoloadCommand.php in vendor/composer/composer/src/Composer/Command/DumpAutoloadCommand.php
EventDispatcher.php in vendor/composer/composer/src/Composer/EventDispatcher/EventDispatcher.php

... See full list

File

vendor/composer/composer/src/Composer/Plugin/CommandEvent.php, line 24

Namespace

Composer\Plugin
View source
class CommandEvent extends Event {
    
    /**
     * @var string
     */
    private $commandName;
    
    /**
     * @var InputInterface
     */
    private $input;
    
    /**
     * @var OutputInterface
     */
    private $output;
    
    /**
     * Constructor.
     *
     * @param string          $name        The event name
     * @param string          $commandName The command name
     * @param mixed[]         $args        Arguments passed by the user
     * @param mixed[]         $flags       Optional flags to pass data not as argument
     */
    public function __construct(string $name, string $commandName, InputInterface $input, OutputInterface $output, array $args = [], array $flags = []) {
        parent::__construct($name, $args, $flags);
        $this->commandName = $commandName;
        $this->input = $input;
        $this->output = $output;
    }
    
    /**
     * Returns the command input interface
     */
    public function getInput() : InputInterface {
        return $this->input;
    }
    
    /**
     * Retrieves the command output interface
     */
    public function getOutput() : OutputInterface {
        return $this->output;
    }
    
    /**
     * Retrieves the name of the command being run
     */
    public function getCommandName() : string {
        return $this->commandName;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
CommandEvent::$commandName private property
CommandEvent::$input private property
CommandEvent::$output private property
CommandEvent::getCommandName public function Retrieves the name of the command being run
CommandEvent::getInput public function Returns the command input interface
CommandEvent::getOutput public function Retrieves the command output interface
CommandEvent::__construct public function Constructor. Overrides Event::__construct
Event::$args protected property
Event::$flags protected property
Event::$name protected property
Event::$propagationStopped private property
Event::getArguments public function Returns the event&#039;s arguments.
Event::getFlags public function Returns the event&#039;s flags.
Event::getName public function Returns the event&#039;s name.
Event::isPropagationStopped public function Checks if stopPropagation has been called
Event::stopPropagation public function Prevents the event from being passed to further listeners

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal