Idle
extends Exception
in package
Class \Hoa\Exception\Idle.
\Hoa\Exception\Idle
is the mother exception class of libraries. The only
difference between \Hoa\Exception\Idle
and its directly child
\Hoa\Exception
is that the latter fires events after beeing constructed.
Tags
Table of Contents
Properties
- $_arguments : array<string|int, mixed>
- Arguments to format message.
- $_previous : Exception
- Previous.
- $_rawMessage : string
- Original message.
- $_tmpArguments : array<string|int, mixed>
- Delay processing on arguments.
- $_trace : array<string|int, mixed>
- Backtrace.
Methods
- __construct() : mixed
- Create an exception.
- __toString() : string
- String representation of object.
- enableUncaughtHandler() : mixed
- Enable uncaught exception handler.
- getArguments() : array<string|int, mixed>
- Get arguments for the message.
- getBacktrace() : array<string|int, mixed>
- Get the backtrace.
- getFormattedMessage() : string
- Get the message already formatted.
- getFrom() : string
- Get the source of the exception (class, method, function, main etc.).
- getPreviousThrow() : Exception
- Get previous.
- getRawMessage() : string
- Get the raw message.
- raise() : string
- Raise an exception as a string.
- uncaught() : void
- Catch uncaught exception (only \Hoa\Exception\Idle and children).
Properties
$_arguments
Arguments to format message.
protected
array<string|int, mixed>
$_arguments
= null
$_previous
Previous.
protected
Exception
$_previous
= null
$_rawMessage
Original message.
protected
string
$_rawMessage
= null
$_tmpArguments
Delay processing on arguments.
protected
array<string|int, mixed>
$_tmpArguments
= null
$_trace
Backtrace.
protected
array<string|int, mixed>
$_trace
= null
Methods
__construct()
Create an exception.
public
__construct(string $message[, int $code = 0 ][, array<string|int, mixed> $arguments = [] ][, Exception $previous = null ]) : mixed
An exception is built with a formatted message, a code (an ID) and an array that contains the list of formatted strings for the message. If chaining, we can add a previous exception.
Parameters
- $message : string
-
Formatted message.
- $code : int = 0
-
Code (the ID).
- $arguments : array<string|int, mixed> = []
-
Arguments to format message.
- $previous : Exception = null
-
Previous exception in chaining.
__toString()
String representation of object.
public
__toString() : string
Return values
stringenableUncaughtHandler()
Enable uncaught exception handler.
public
static enableUncaughtHandler([bool $enable = true ]) : mixed
This is restricted to Hoa's exceptions only.
Parameters
- $enable : bool = true
-
Enable.
getArguments()
Get arguments for the message.
public
getArguments() : array<string|int, mixed>
Return values
array<string|int, mixed>getBacktrace()
Get the backtrace.
public
getBacktrace() : array<string|int, mixed>
Do not use \Exception::getTrace() any more.
Return values
array<string|int, mixed>getFormattedMessage()
Get the message already formatted.
public
getFormattedMessage() : string
Return values
stringgetFrom()
Get the source of the exception (class, method, function, main etc.).
public
getFrom() : string
Return values
stringgetPreviousThrow()
Get previous.
public
getPreviousThrow() : Exception
Do not use \Exception::getPrevious() any more.
Return values
ExceptiongetRawMessage()
Get the raw message.
public
getRawMessage() : string
Return values
stringraise()
Raise an exception as a string.
public
raise([bool $previous = false ]) : string
Parameters
- $previous : bool = false
-
Whether raise previous exception if exists.
Return values
stringuncaught()
Catch uncaught exception (only \Hoa\Exception\Idle and children).
public
static uncaught(Throwable $exception) : void
Parameters
- $exception : Throwable
-
The exception.