ApplicationErrorEvent
Extends ConsoleEventEvent triggered when an uncaught Throwable is received by the application.
| since |
2.0.0 |
|---|---|
| package |
Joomla Framework |
Methods
__construct
Event constructor.
__construct(\Throwable error, \Joomla\Console\Application application, \Joomla\Console\Command\AbstractCommand|null command = null) :
| since |
2.0.0 |
|---|
Arguments
- error
ThrowableThe Throwable object with the error data.- application
ApplicationThe active application.- command
AbstractCommand|nullThe command being executed.
Response
mixed
__serialize
Serialize the event.
__serialize() : mixed||string|int
| since |
2.0.0 |
|---|
Response
array<string|int, mixed>The data to be serialized
__unserialize
Unserialize the event.
__unserialize(mixed||string|int data) :
| since |
2.0.0 |
|---|
Arguments
- data
array<string|int, mixed>The serialized event.
Response
void
addArgument
Add an event argument, only if it is not existing.
addArgument( name, value) :
| since |
1.0 |
|---|
Arguments
- name
stringThe argument name.- value
mixedThe argument value.
Response
$this
clearArguments
Clear all event arguments.
clearArguments() : mixed||string|int
| since |
1.0 |
|---|
Response
array<string|int, mixed>The old arguments.
count
Count the number of arguments.
count() :
| since |
1.0 |
|---|
Response
intThe number of arguments.
getApplication
Get the active application.
getApplication() : \Joomla\Console\Application
getArgument
Get an event argument value.
getArgument( name, default = null) :
| since |
1.0 |
|---|
Arguments
- name
stringThe argument name.- default
mixedThe default value if not found.
Response
mixedThe argument value or the default value.
getArguments
Get all event arguments.
getArguments() : mixed||string|int
| since |
1.0 |
|---|
Response
array<string|int, mixed>An associative array of argument names as keys and their values as values.
getCommand
Get the command being executed.
getCommand() : \Joomla\Console\Command\AbstractCommand|null
getError
Get the error object.
getError() : \Throwable
| since |
2.0.0 |
|---|
Response
Throwable
getExitCode
Gets the exit code.
getExitCode() :
| since |
2.0.0 |
|---|
Response
int
getName
Get the event name.
getName() :
| since |
1.0 |
|---|
Response
stringThe event name.
hasArgument
Tell if the given event argument exists.
hasArgument( name) :
| since |
1.0 |
|---|
Arguments
- name
stringThe argument name.
Response
boolTrue if it exists, false otherwise.
isStopped
Tell if the event propagation is stopped.
isStopped() :
| since |
1.0 |
|---|
Response
boolTrue if stopped, false otherwise.
offsetExists
Tell if the given event argument exists.
offsetExists( name) :
| since |
1.0 |
|---|
Arguments
- name
stringThe argument name.
Response
boolTrue if it exists, false otherwise.
offsetGet
Get an event argument value.
offsetGet( name) :
| since |
1.0 |
|---|
Arguments
- name
stringThe argument name.
Response
mixedThe argument value or null if not existing.
offsetSet
Set the value of an event argument.
offsetSet( name, value) :
| since |
1.0 |
|---|---|
| throws |
|
Arguments
- name
stringThe argument name.- value
mixedThe argument value.
Response
void
offsetUnset
Remove an event argument.
offsetUnset( name) :
| since |
1.0 |
|---|
Arguments
- name
stringThe argument name.
Response
void
removeArgument
Remove an event argument.
removeArgument( name) :
| since |
1.0 |
|---|
Arguments
- name
stringThe argument name.
Response
mixedThe old argument value or null if it is not existing.
serialize
Serialize the event.
serialize() :
| since |
1.0 |
|---|
Response
stringThe serialized event.
setArgument
Add argument to event.
setArgument( name, value) :
| since |
1.0 |
|---|
Arguments
- name
stringArgument name.- value
mixedValue.
Response
$this
setError
Set the error object.
setError(\Throwable error) :
| since |
2.0.0 |
|---|
Arguments
- error
ThrowableThe error object to set to the event.
Response
void
setExitCode
Sets the exit code.
setExitCode( exitCode) :
| since |
2.0.0 |
|---|
Arguments
- exitCode
intThe command exit code.
Response
void
stop
Stop the event propagation.
stop() :
| since |
1.0 |
|---|---|
| deprecated |
3.0 Use stopPropagation instead |
Response
void
stopPropagation
Stops the propagation of the event to further event listeners.
stopPropagation() :
| since |
2.0.0 |
|---|
Response
void
unserialize
Unserialize the event.
unserialize( serialized) :
| since |
1.0 |
|---|
Arguments
- serialized
stringThe serialized event.
Response
void
Properties
name
The event name.
| since |
1.0 |
|---|
Type(s)
string
arguments
The event arguments.
| since |
1.0 |
|---|
Type(s)
array<string|int, mixed>
stopped
A flag to see if the event propagation is stopped.
| since |
1.0 |
|---|
Type(s)
bool
error
The Throwable object with the error data.
| since |
2.0.0 |
|---|
Type(s)
Throwable
exitCode
The exit code to use for the application.
| since |
2.0.0 |
|---|
Type(s)
int|null