Consider expressing the Fourier series as
$$f(x) = \sum_{n=-\infty}^{+\infty}(a_n\cos nx+b_n\sin nx)$$
where
$a_n=\frac{1}{2\pi}\int_{-\pi}^{+\pi}f(t)\cos nxt\ dt$ and $b_n=\frac{1}{2\pi}\int_{-\pi}^{+\pi}f(t)\sin nxt\ dt$.
Note that $\cos\phi$ is an even function, i.e. $\cos(-\phi)=\cos\phi$, and therefore $a_{-n} = a_n$. Similarly, $\sin\phi$ is an odd function, i.e. $\sin(-\phi)=-\sin\phi$, and therefore $b_{-n} = -b_n$. Thus, we can combine the terms with the positive and negative $n$ of the same absolute value, which will result in doubled coefficients $2a_n$ and $2b_n$ for $n>0$, while the terms with $n<0$ will be dropped. Since the terms with $n=0$ do not have a pair, they will not be doubled, so $a_0$ will remain the same, and $b_0$ can be omitted since $b_0=0$.