class CommandEvent extends Event (View source)

An event for all commands.

Properties

protected string $name from Event
protected array $args from Event
protected array $flags from Event

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
bool
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

__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

string getName()

Returns the event's name.

Return Value

string The event name

array getArguments()

Returns the event's arguments.

Return Value

array The event arguments

array getFlags()

Returns the event's flags.

Return Value

array The event flags

bool isPropagationStopped()

Checks if stopPropagation has been called

Return Value

bool Whether propagation has been stopped

stopPropagation()

Prevents the event from being passed to further listeners

InputInterface getInput()

Returns the command input interface

Return Value

InputInterface

OutputInterface getOutput()

Retrieves the command output interface

Return Value

OutputInterface

string getCommandName()

Retrieves the name of the command being run

Return Value

string