AbstractMethod
extends AbstractError
in package
implements
MethodInterface
This is a simple Method implementation that other Method can inherit from.
Table of Contents
Interfaces
- MethodInterface
- Describes Method interface.
Properties
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.
- getMethod() : callable|null
- Retrieve a validation method callback by the given case-sensitive name.
- getMethods() : array<string, callable>
- Retrieves all validation method callbacks.
- hasError() : bool
- Checks if a error exists by the given case-sensitive name.
- hasMethod() : bool
- Checks if a method exists by the given case-sensitive name.
- withError() : static
- Return an instance with the provided value replacing the specified error.
- withMethod() : static
- Return an instance with the provided callback replacing the specified method.
- withoutError() : static
- Return an instance without the specified error.
- withoutMethod() : static
- Return an instance without the specified method.
Properties
$errors
private
array<string, array<string, mixed>>
$errors
= []
$methods
private
array<string, callable>
$methods
= []
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>>getMethod()
Retrieve a validation method callback by the given case-sensitive name.
public
getMethod(string $Name) : callable|null
Parameters
- $Name : string
-
The method name.
Return values
callable|nullgetMethods()
Retrieves all validation method callbacks.
public
getMethods() : array<string, callable>
Return values
array<string, callable>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
boolhasMethod()
Checks if a method exists by the given case-sensitive name.
public
hasMethod(string $Name) : bool
Parameters
- $Name : string
-
The method 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
staticwithMethod()
Return an instance with the provided callback replacing the specified method.
public
withMethod(string $Name, callable $Callback) : static
Parameters
- $Name : string
-
The method name.
- $Callback : callable
-
The method callback.
Return values
staticwithoutError()
Return an instance without the specified error.
public
withoutError(string $Name) : static
Parameters
- $Name : string
-
The error name.
Return values
staticwithoutMethod()
Return an instance without the specified method.
public
withoutMethod(string $Name) : static
Parameters
- $Name : string
-
The method name.