public function validatePassword($password)
{
foreach ($this->validOptions as $option) {
$minCount = $this->getMinimumCount($option);
$maxCount = $this->getMaximumCount($option);
$count = strlen(preg_replace('|[^' . preg_quote($this->getParameter($option)) . ']|', '', $password));
if (!is_null($minCount) && $count < $minCount) {
return false;
}
if (!is_null($maxCount) && $count > $maxCount) {
return false;
}
}
return true;
}