Class PhpError
Object wrapper around PHP errors that are emitted by trigger_error()
Namespace: Cake\Error
Method Summary
-
__construct() public
Constructor
-
getCode() public
Get the PHP error constant.
-
getFile() public
Get the error file
-
getLabel() public
Get the error code label
-
getLine() public
Get the error line number.
-
getLogLevel() public
Get the mapped LOG_ constant.
-
getMessage() public
Get the error message.
-
getTrace() public
Get the stacktrace as an array.
-
getTraceAsString() public
Get the stacktrace as a string.
Method Detail
__construct() ¶ public
__construct(int $code, string $message, string|null $file = null, int|null $line = null, array $trace = [])
Constructor
Parameters
-
int
$code The PHP error code constant
-
string
$message The error message.
-
string|null
$file optional The filename of the error.
-
int|null
$line optional The line number for the error.
-
array
$trace optional The backtrace for the error.
getTraceAsString() ¶ public
getTraceAsString(): string
Get the stacktrace as a string.
Returns
string