BuildInLengthMax
extends AbstractBuildIn
in package
Simple Build-In Length Max implementation.
Table of Contents
Properties
- $assert : string
- $error_code : int
- $error_message : string
Methods
- getAssert() : string
- Retrieve assert name.
- getErrorCode() : int
- Retrieve error code.
- getErrorMessage() : string
- Retrieve error message.
- getMethod() : callable
- Retrieve method callback.
- guardInvalidType() : static
- Guard an instance from invalid type of value.
- guardNonExists() : static
- Guard an instance from nonexists of data.
Properties
$assert
protected
string
$assert
= "length-max"
$error_code
protected
int
$error_code
= \Samy\Validation\Constant\ValidationError::LENGTH_MAX
$error_message
protected
string
$error_message
= "The '{{attribute}}' must be less or equal to {{expect}} characters."
Methods
getAssert()
Retrieve assert name.
public
getAssert() : string
Return values
stringgetErrorCode()
Retrieve error code.
public
getErrorCode() : int
Return values
intgetErrorMessage()
Retrieve error message.
public
getErrorMessage() : string
Return values
stringgetMethod()
Retrieve method callback.
public
getMethod() : callable
Return values
callableguardInvalidType()
Guard an instance from invalid type of value.
public
guardInvalidType(mixed $Value, array<string|int, string> $Types, string $ErrorMessage, int $ErrorCode) : static
Parameters
- $Value : mixed
-
The value.
- $Types : array<string|int, string>
-
The expect types.
- $ErrorMessage : string
-
The error message.
- $ErrorCode : int
-
The error code.
Tags
Return values
staticguardNonExists()
Guard an instance from nonexists of data.
public
guardNonExists(array<string|int, mixed> $Data, string $Key, string $ErrorMessage, int $ErrorCode) : static
Parameters
- $Data : array<string|int, mixed>
-
The data.
- $Key : string
-
The key.
- $ErrorMessage : string
-
The error message.
- $ErrorCode : int
-
The error code.