Analytic solutions for the generalized complex Ginzburg–Landau equation in fiber lasers