AbstractError
in package
implements
ErrorInterface
AbstractYes
This is a simple Error implementation that other Error can inherit from.
Table of Contents
Interfaces
- ErrorInterface
- Describes Error interface.
Properties
- $errors : array<string, array<string, mixed>>
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.
Properties
$errors
private
array<string, array<string, mixed>>
$errors
= []
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
boolwithError()
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
staticwithoutError()
Return an instance without the specified error.
public
withoutError(string $Name) : static
Parameters
- $Name : string
-
The error name.