Documentation

RegexValidationRule
in package
implements ValidationRule

Validates a value is not empty. This allows the system to make sure that a required field has not been field with useless data.

Tags
author

César de la Cal cesar@magic3w.com

Interfaces, Classes and Traits

ValidationRule
Classes implementing this one indicate their ability to test a variable and verify that it's contents are according to what was expected.

Table of Contents

$extendedMessage  : string
Additional information given to the user in case the validation did not succeed. This message can hold additional infos on how to solve the error.
$message  : string
A message the validation error generated by this object should carry to give the end user information about the reason his input was rejected.
$regex  : string
The regular expression we wish to test the content of the validator against.
__construct()  : mixed
test()  : ValidationError|bool
Tests a value with this validation rule. Returns the errors detected for this element or boolean false on no errors.

Properties

$extendedMessage

Additional information given to the user in case the validation did not succeed. This message can hold additional infos on how to solve the error.

private string $extendedMessage

$message

A message the validation error generated by this object should carry to give the end user information about the reason his input was rejected.

private string $message

$regex

The regular expression we wish to test the content of the validator against.

private string $regex

Methods

__construct()

public __construct(mixed $regex, mixed $message[, mixed $extendedMessage = '' ]) : mixed
Parameters
$regex : mixed
$message : mixed
$extendedMessage : mixed = ''
Return values
mixed

test()

Tests a value with this validation rule. Returns the errors detected for this element or boolean false on no errors.

public test(mixed $value) : ValidationError|bool
Parameters
$value : mixed
Return values
ValidationError|bool

Search results