public function generatePassword()
{
$vowels = $this->getParameter(self::PARAMETER_VOWELS, '');
if (!strlen($vowels)) {
return parent::generatePassword();
}
$characterList = $this->getCharacterList()->getCharacters();
$charactersCount = strlen($characterList);
$password = '';
$length = $this->getLength();
$isLastCharVowel = null;
for ($i = 0; $i < $length; ++$i) {
do {
$char = $characterList[$this->randomInteger(0, $charactersCount - 1)];
$isVowel = false !== stripos($vowels, $char);
} while (null !== $isLastCharVowel && $isVowel === $isLastCharVowel);
$password .= $char;
$isLastCharVowel = $isVowel;
}
return $password;
}