public function updatePassword($userId, $password) { if (!empty($password)) { $this->userDao->updatePassword((int) $userId, $this->hashPassword($password)); } else { throw new InvalidArgumentException('Invalid password!'); } }