ELP Parser API

Diagnostic
in package
implements JsonSerializable

FinalYes

Typed validation diagnostic.

Table of Contents

Interfaces

JsonSerializable

Constants

ERROR  : mixed = 'error'
WARNING  : mixed = 'warning'

Properties

$code  : string
$context  : array<string, mixed>
$message  : string
$severity  : string

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

Properties

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
self

getCode()

public getCode() : string
Return values
string

getContext()

public getContext() : array<string, mixed>
Return values
array<string, mixed>

getMessage()

public getMessage() : string
Return values
string

getSeverity()

public getSeverity() : string
Return values
string

toArray()

public toArray() : array<string, mixed>
Return values
array<string, mixed>
On this page

Search results