Documentation

RuleInterface

This is a rule for performing validation.

Table of Contents

Methods

fields()  : array<string|int, string>
What fields are registered for this rule?
getName()  : string
The shorthand name for this rule.
parse()  : void
Parse a ruleset.
validate()  : void
Validate data against this rule.

Methods

fields()

What fields are registered for this rule?

public fields() : array<string|int, string>
Return values
array<string|int, string>

getName()

The shorthand name for this rule.

public static getName() : string
Return values
string

parse()

Parse a ruleset.

public parse(array<string|int, mixed> $ruleset) : void

This typically specifies the fields to validate and any configurable options.

Invalid rulesets should raise an exception.

Parameters
$ruleset : array<string|int, mixed>

validate()

Validate data against this rule.

public validate(array<string|int, mixed>|object $data) : void

This should throw an exception if validation fails.

Parameters
$data : array<string|int, mixed>|object
On this page

Search results