/** * @param UserEntity $userObject * @param $password * @param Bcrypt $bcrypt * @return $this|bool */ protected function updateUserPasswordHash(UserEntity $userObject, $password, Bcrypt $bcrypt) { $hash = explode('$', $userObject->getPassword()); if ($hash[2] === $bcrypt->getCost()) { return true; } $userObject->setPassword($bcrypt->create($password)); $this->getUserMapper()->update($userObject); return $this; }