Class PhpError
Object wrapper around PHP errors that are emitted by trigger_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.
getCode() public
getCode(): int
Get the PHP error constant.
Returns
intgetFile() public
getFile(): string|null
Get the error file
Returns
string|nullgetLabel() public
getLabel(): string
Get the error code label
Returns
stringgetLine() public
getLine(): int|null
Get the error line number.
Returns
int|nullgetLogLevel() public
getLogLevel(): int
Get the mapped LOG_ constant.
Returns
intgetMessage() public
getMessage(): string
Get the error message.
Returns
stringgetTrace() public
getTrace(): array
Get the stacktrace as an array.
Returns
arraygetTraceAsString() public
getTraceAsString(): string
Get the stacktrace as a string.
Returns
string
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/class-Cake.Error.PhpError.html