class PasswordGenerator extends RandomGenerator implements PasswordGeneratorInterface (View source)

Properties

protected $logger from RandomGenerator
protected $useOpenSsl from RandomGenerator

Methods

__construct(LoggerInterface $logger = null)

No description

string
generatePassword(integer $length = 9)

Generates a strong password of N length containing at least one lower case letter, one uppercase letter, one digit, and one special character. The remaining characters in the password are chosen at random from those four sets.

Details

__construct(LoggerInterface $logger = null)

Parameters

LoggerInterface $logger

string generatePassword(integer $length = 9)

Generates a strong password of N length containing at least one lower case letter, one uppercase letter, one digit, and one special character. The remaining characters in the password are chosen at random from those four sets.

The available characters in each set are user friendly - there are no ambiguous characters such as i, l, 1, o, 0, etc.

Parameters

integer $length

Return Value

string

See also

https://gist.github.com/tylerhall/521810