CommandEvent
extends Event
in package
The Command Event.
Tags
Table of Contents
- $args : array<string|int, mixed>
- $flags : array<string|int, mixed>
- $name : string
- $composer : Composer
- $devMode : bool
- $io : IOInterface
- $originatingEvent : Event
- $propagationStopped : bool
- __construct() : mixed
- Constructor.
- getArguments() : array<string|int, mixed>
- Returns the event's arguments.
- getComposer() : Composer
- Returns the composer instance.
- getFlags() : array<string|int, mixed>
- Returns the event's flags.
- getIO() : IOInterface
- Returns the IO instance.
- getName() : string
- Returns the event's name.
- getOriginatingEvent() : Event|null
- Set the originating event.
- isDevMode() : bool
- Return the dev mode flag
- isPropagationStopped() : bool
- Checks if stopPropagation has been called
- setOriginatingEvent() : $this
- Set the originating event.
- stopPropagation() : mixed
- Prevents the event from being passed to further listeners
- calculateOriginatingEvent() : Event
- Returns the upper-most event in chain.
Properties
$args
protected
array<string|int, mixed>
$args
Arguments passed by the user, these will be forwarded to CLI script handlers
$flags
protected
array<string|int, mixed>
$flags
Flags usable in PHP script handlers
$name
protected
string
$name
This event's name
$composer
private
Composer
$composer
The composer instance
$devMode
private
bool
$devMode
Dev mode flag
$io
private
IOInterface
$io
The IO instance
$originatingEvent
private
Event
$originatingEvent
$propagationStopped
private
bool
$propagationStopped
= false
Whether the event should not be passed to more listeners
Methods
__construct()
Constructor.
public
__construct(string $name[, array<string|int, mixed> $args = array() ][, array<string|int, mixed> $flags = array() ]) : mixed
Parameters
- $name : string
-
The event name
- $args : array<string|int, mixed> = array()
-
Arguments passed by the user
- $flags : array<string|int, mixed> = array()
-
Optional flags to pass data not as argument
Return values
mixed —getArguments()
Returns the event's arguments.
public
getArguments() : array<string|int, mixed>
Return values
array<string|int, mixed> —The event arguments
getComposer()
Returns the composer instance.
public
getComposer() : Composer
Return values
Composer —getFlags()
Returns the event's flags.
public
getFlags() : array<string|int, mixed>
Return values
array<string|int, mixed> —The event flags
getIO()
Returns the IO instance.
public
getIO() : IOInterface
Return values
IOInterface —getName()
Returns the event's name.
public
getName() : string
Return values
string —The event name
getOriginatingEvent()
Set the originating event.
public
getOriginatingEvent() : Event|null
Return values
Event|null —isDevMode()
Return the dev mode flag
public
isDevMode() : bool
Return values
bool —isPropagationStopped()
Checks if stopPropagation has been called
public
isPropagationStopped() : bool
Return values
bool —Whether propagation has been stopped
setOriginatingEvent()
Set the originating event.
public
setOriginatingEvent(Event $event) : $this
Parameters
- $event : Event
Return values
$this —stopPropagation()
Prevents the event from being passed to further listeners
public
stopPropagation() : mixed
Return values
mixed —calculateOriginatingEvent()
Returns the upper-most event in chain.
private
calculateOriginatingEvent(Event $event) : Event
Parameters
- $event : Event