class Ip extends Rule (View source)

Properties

protected $failure from  Rule
protected $alloweds from  Rule
protected $messages

Methods

bool
exec(string $path, mixed $value, string|null $param, array $rules)

Executes the rule on a value.

isAllowed(array $rules)

Check if the rules are accepted

from  Rule
bool
passed()

Validate after set $failure

from  Rule
string|null
getFailure()

Returns a string if a failure occurs; otherwise, returns null

from  Rule
setMessage(string $type, string $message)

No description

from  Rule

Details

bool exec(string $path, mixed $value, string|null $param, array $rules)

Executes the rule on a value.

Parameters

string $path

Path of the field being validated

mixed $value

Value of the field (scalar); may be sanitized

string|null $param

Text after : in the rule (e.g. foo in rule:foo), or null if absent

array $rules

Other rules applied to the same field (name => parameter)

Return Value

bool

True if valid; false otherwise.

Exceptions

RuntimeException

final protected isAllowed(array $rules)

Check if the rules are accepted

Parameters

array $rules

Exceptions

RuntimeException

final protected bool passed()

Validate after set $failure

Return Value

bool

final string|null getFailure()

Returns a string if a failure occurs; otherwise, returns null

Return Value

string|null

final setMessage(string $type, string $message)

No description

Parameters

string $type

Message type

string $message Message

Exceptions

Exception