public function encodePassword($password,
$encoderName) { if (!\
is_string($password) ||
empty($password)) { throw new DomainException('This Password can not be encoded'
);
} $encoder =
$this->
getEncoderByName($encoderName);
$encodedPassword =
$encoder->
encodePassword($password);
if (!\
is_string($encodedPassword)) { throw new DomainException(sprintf('The password could not be encoded by %s.',
$encoderName));
} return $encodedPassword;
} /**
* @param string $password
* @param string $hash
* @param string $encoderName
*
* @return string
*/