/** * @param \User\Entity\Auth $auth * @param $password * @return string */ public static function encrypt(\User\Entity\Auth $auth, $password) { $bcrypt = new Bcrypt(); $bcrypt->setSalt($auth->getTokenSecret()); return $bcrypt->create($password); }