Class ClosureValidator

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

Concrete\Core\Validator\ClosureValidator implements Concrete\Core\Validator\ValidatorInterface
Namespace: Concrete\Core\Validator
Package: Concrete\Core\Validator
Located at src/Validator/ClosureValidator.php

Methods summary

# __construct( Closure $validator_closure, Closure $requirements_closure )

ClosureValidator constructor.

# setValidatorClosure( Closure $validator_closure )

Set the closure that handls validation function(ClosureValidator $validator, mixed $passed, \Concrete\Core\Error $error = null): bool

# setRequirementsClosure( Closure $requirements_closure )

Set the closure that returns requirements

public string[]
# getRequirementStrings( )

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

public boolean
# isValid( mixed $mixed, ArrayAccess $error = null )

Is this mixed value valid

Properties summary

protected $validator_closure
protected $requirements_closure