PHP Validation

AbstractBuildIn
in package
implements BuildInInterface

AbstractYes

This is a simple BuildIn implementation that other BuildIn can inherit from.

Table of Contents

Interfaces

BuildInInterface
Describes Build-In interface.

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

Methods

getAssert()

Retrieve assert name.

public getAssert() : string
Return values
string

getErrorCode()

Retrieve error code.

public getErrorCode() : int
Return values
int

getErrorMessage()

Retrieve error message.

public getErrorMessage() : string
Return values
string

getMethod()

Retrieve method callback.

public abstract getMethod() : callable
Return values
callable

guardInvalidType()

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
throws
InvalidArgumentException

If invalid.

Return values
static

guardNonExists()

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.

Tags
throws
InvalidArgumentException

If invalid.

Return values
static

        
On this page

Search results