interface ValidatorInterface (View source)

Interface ValidatorInterface A generic validator cabable of describing itself and validating mixed values.

\@package Concrete\Core\Validator

Methods

string[]
getRequirementStrings()

Get the validator requirements in the form of an array keyed by it's respective error code.

bool
isValid(mixed $mixed, ArrayAccess $error = null)

Is this mixed value valid.

Details

string[] getRequirementStrings()

Get the validator requirements in the form of an array keyed by it's respective error code.

Example: [ self::E_TOO_SHORT => 'Must be at least 10 characters' ]

Return Value

string[]

bool isValid(mixed $mixed, ArrayAccess $error = null)

Is this mixed value valid.

Parameters

mixed $mixed

Can be any value

ArrayAccess $error

Return Value

bool

Exceptions

InvalidArgumentException