PHP Validation

ErrorInterface

Describes Error interface.

Table of Contents

Methods

getError()  : array<string, mixed>
Retrieve a validation error value by the given case-sensitive name.
getErrors()  : array<string, array<string, mixed>>
Retrieves all validation error values.
hasError()  : bool
Checks if a error exists by the given case-sensitive name.
withError()  : static
Return an instance with the provided value replacing the specified error.
withoutError()  : static
Return an instance without the specified error.

Methods

getError()

Retrieve a validation error value by the given case-sensitive name.

public getError(string $Name) : array<string, mixed>
Parameters
$Name : string

The error name.

Return values
array<string, mixed>

getErrors()

Retrieves all validation error values.

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

hasError()

Checks if a error exists by the given case-sensitive name.

public hasError(string $Name) : bool
Parameters
$Name : string

The error name.

Return values
bool

withError()

Return an instance with the provided value replacing the specified error.

public withError(string $Name, string $Message[, int $Code = 0 ]) : static
Parameters
$Name : string

The error name.

$Message : string

The error message.

$Code : int = 0

The error code.

Return values
static

withoutError()

Return an instance without the specified error.

public withoutError(string $Name) : static
Parameters
$Name : string

The error name.

Return values
static

        
On this page

Search results