class JsonFormatter extends AbstractFormatter (View source)

Properties

protected ErrorList $error

The error list to be formatted.

from  AbstractFormatter

Methods

__construct(ErrorList $error)

Initialize the instance.

string
render()

Render the error list.

array|null
asArray()

Build an array describing the errors.

Details

__construct(ErrorList $error)

Initialize the instance.

Parameters

ErrorList $error

the error list to be formatted

string render()

Render the error list.

Return Value

string

See also

FormatterInterface::render

array|null asArray()

Build an array describing the errors.

Return Value

array|null

return NULL if the error list is empty, an array otherwise