Diagnostic
in package
implements
JsonSerializable
FinalYes
Typed validation diagnostic.
Table of Contents
Interfaces
- JsonSerializable
Constants
Properties
Methods
- __construct() : mixed
- fromArray() : self
- Build a diagnostic from the existing array contract.
- getCode() : string
- getContext() : array<string, mixed>
- getMessage() : string
- getSeverity() : string
- jsonSerialize() : mixed
- toArray() : array<string, mixed>
Constants
ERROR
public
mixed
ERROR
= 'error'
WARNING
public
mixed
WARNING
= 'warning'
Properties
$code
private
string
$code
$context
private
array<string, mixed>
$context
$message
private
string
$message
$severity
private
string
$severity
Methods
__construct()
public
__construct(string $severity, string $code, string $message[, array<string, mixed> $context = [] ]) : mixed
Parameters
- $severity : string
-
Diagnostic severity.
- $code : string
-
Stable diagnostic code.
- $message : string
-
Human-readable message.
- $context : array<string, mixed> = []
-
Diagnostic context.
fromArray()
Build a diagnostic from the existing array contract.
public
static fromArray(array<string, mixed> $data, string $severity) : self
Parameters
- $data : array<string, mixed>
-
Diagnostic data.
- $severity : string
-
Severity.
Return values
selfgetCode()
public
getCode() : string
Return values
stringgetContext()
public
getContext() : array<string, mixed>
Return values
array<string, mixed>getMessage()
public
getMessage() : string
Return values
stringgetSeverity()
public
getSeverity() : string
Return values
stringjsonSerialize()
public
jsonSerialize() : mixed
toArray()
public
toArray() : array<string, mixed>