private function encodePassword(UserInterface $user, $password, $salt)
    {
        $encoder = $this->get('sulu_security.encoder_factory')->getEncoder($user);

        return $encoder->encodePassword($password, $salt);
    }