Here are some levels used by applications to determine the strength of a password:
In order to support these various requirements, the following rules would be needed:
// Where numberCharacters means the number of required characters to match
// strict = true means at most the provided number
// while strict = false means at least the number of characters provided
new ContainsUppercaseCharacters($numberCharacters = 1, $strict = false, $message = null);
new ContainsLowercaseCharacters($numberCharacters = 1, $strict = false, $message = null);
new ContainsNumericCharacters($numberCharacters = 1, $strict = false, $message = null);
// For Special characters, to allow users of the library to define their own set of special chars
new MatchesRegex($regex, $message);
// Min Length
new MinLength($length, $message);
new Length($length, $message); // For Exact length
Here are some levels used by applications to determine the strength of a password:
In order to support these various requirements, the following rules would be needed: