public function askPassword(InputInterface $input, OutputInterface $output, $argumentName = 'password', $needDigits = true)
{
$validators = array();
if ($needDigits) {
$regex = array('pattern' => '/^(?=.*\\d)(?=.*[a-zA-Z])/', 'message' => 'Password must contain letters and at least one digit');
$validators[] = new Constraints\Regex($regex);
}
$validators[] = new Constraints\Length(array('min' => 6));
$constraints = new Constraints\Collection(array('password' => $validators));
return $this->validateArgument($output, $argumentName, $input->getArgument($argumentName), $constraints);
}