Fermi LAT search for dark matter in gamma-ray lines and the inclusive photon spectrum