Error extends Error
Table of Contents
Constants
- FILE_NOT_FOUND = 'FILE_NOT_FOUND'
- MODULE_NOT_INSTALLED = 'MODULE_NOT_INSTALLED'
- USER_NOT_FOUND = 'USER_NOT_FOUND'
Methods
- __construct() : mixed
- Creates a new Error.
- __toString() : mixed
- __unserialize() : void
- Disables deserialization.
- createFromThrowable() : static
- fromCode() : self
- getCode() : int|string
- Returns the code of the error.
- getCodes() : array<string|int, mixed>
- getCustomData() : mixed|null
- getLocalizableMessage() : LocalizableMessageInterface|null
- getMessage() : string
- Returns the message of the error.
- jsonSerialize() : mixed
- Specify data which should be serialized to JSON
Constants
FILE_NOT_FOUND
public
mixed
FILE_NOT_FOUND
= 'FILE_NOT_FOUND'
MODULE_NOT_INSTALLED
public
mixed
MODULE_NOT_INSTALLED
= 'MODULE_NOT_INSTALLED'
USER_NOT_FOUND
public
mixed
USER_NOT_FOUND
= 'USER_NOT_FOUND'
Methods
__construct()
Creates a new Error.
public
__construct(string $message[, int|string $code = 0 ][, mixed|null $customData = null ]) : mixed
Parameters
- $message : string
-
Message of the error.
- $code : int|string = 0
-
Code of the error.
- $customData : mixed|null = null
-
Data typically of key/value pairs that provide additional user-defined information about the error.
__toString()
public
__toString() : mixed
__unserialize()
Disables deserialization.
public
__unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
createFromThrowable()
public
static createFromThrowable(Throwable $exception) : static
Parameters
- $exception : Throwable
Return values
staticfromCode()
public
static fromCode(string $code[, mixed $customData = null ]) : self
Parameters
- $code : string
- $customData : mixed = null
Return values
selfgetCode()
Returns the code of the error.
public
getCode() : int|string
Return values
int|stringgetCodes()
public
static getCodes() : array<string|int, mixed>
Return values
array<string|int, mixed>getCustomData()
public
getCustomData() : mixed|null
Return values
mixed|nullgetLocalizableMessage()
public
getLocalizableMessage() : LocalizableMessageInterface|null
Return values
LocalizableMessageInterface|nullgetMessage()
Returns the message of the error.
public
getMessage() : string
Return values
stringjsonSerialize()
Specify data which should be serialized to JSON
public
jsonSerialize() : mixed
Tags
Attributes
- #[ReturnTypeWillChange]
Return values
mixed —data which can be serialized by json_encode, which is a value of any type other than a resource.