Composer API
Class

Composer\Plugin\CommandEvent

class CommandEvent extends Event

An event for all commands.

Methods

__construct(string $name, string $commandName, InputInterface $input, OutputInterface $output, array $args = array(), array $flags = array())

Constructor.

string getName()

Returns the event's name.

from Event
array getArguments()

Returns the event's arguments.

from Event
array getFlags()

Returns the event's flags.

from Event
boolean isPropagationStopped()

Checks if stopPropagation has been called

from Event
stopPropagation()

Prevents the event from being passed to further listeners

from Event
InputInterface getInput()

Returns the command input interface

OutputInterface getOutput()

Retrieves the command output interface

string getCommandName()

Retrieves the name of the command being run

Details

at line 51
public __construct(string $name, string $commandName, InputInterface $input, OutputInterface $output, array $args = array(), array $flags = array())

Constructor.

Parameters

string $name The event name
string $commandName The command name
InputInterface $input
OutputInterface $output
array $args Arguments passed by the user
array $flags Optional flags to pass data not as argument

in Event at line 61
public string getName()

Returns the event's name.

Return Value

string The event name

in Event at line 71
public array getArguments()

Returns the event's arguments.

Return Value

array The event arguments

in Event at line 81
public array getFlags()

Returns the event's flags.

Return Value

array The event flags

in Event at line 91
public boolean isPropagationStopped()

Checks if stopPropagation has been called

Return Value

boolean Whether propagation has been stopped

in Event at line 99
public stopPropagation()

Prevents the event from being passed to further listeners

at line 64
public InputInterface getInput()

Returns the command input interface

Return Value

InputInterface

at line 74
public OutputInterface getOutput()

Retrieves the command output interface

Return Value

OutputInterface

at line 84
public string getCommandName()

Retrieves the name of the command being run

Return Value

string