Provides password validation.

package OwpPasswordValidator

 Methods

validate

validate(string $value, object $constraint) : mixed
Static
method
access public
author Brian Tafoya
version 1.0

Parameters

$value

string

Password value

$constraint

object

Constraints

Returns

mixedViolation array or false if no violations

addViolation

addViolation(string $violation) 
Static
method
access private
author Brian Tafoya
version 1.0

Parameters

$violation

string

Violation to record

 Properties

 

Allowed Characterset

$charset : string

Default

'UTF-8'
Static
 

Validation constraints

$constraint : object

Default

Static
 

MaxLength

$maxLength : string

Default

0
Static
 

MinLength

$minLength : string

Default

5
Static
 

MissingLettersMessage

$missingLettersMessage : string

Default

'Your password must include at least one letter.'
Static
 

MissingNonAlphanumericMessage

$missingNonAlphanumericMessage : string

Default

'Your password must include at least one non-alphanumeric character.'
Static
 

MissingNumbersMessage

$missingNumbersMessage : string

Default

'Your password must include at least one digit.'
Static
 

RequireCaseDiff

$requireCaseDiff : string

Default

false
Static
 

RequireCaseDiffMessage

$requireCaseDiffMessage : string

Default

'Your password must include both upper and lower case letters.'
Static
 

RequireLetters

$requireLetters : string

Default

true
Static
 

RequireNonAlphanumeric

$requireNonAlphanumeric : string

Default

false
Static
 

RequireNumbers

$requireNumbers : string

Default

false
Static
 

TooLongMessage

$tooLongMessage : string

Default

'Your password must not exceed {{maxlength}} characters.'
Static
 

TooShortMessage

$tooShortMessage : string

Default

'Your password must be at least {{minlength}} characters long.'
Static
 

Violation array

$violations : string

Default

array()
Static