The only area of scoring where closing an account can hurt you is in the revolving utilization calculations. While a closed revolving account with a balance is included in utilization, a closed account with a zero balance is not.
In the area of length of credit history, closed accounts are treated no differently than open accounts. That is, the length of history on a closed acct still gets counted right along with the rest of the closed account's history. In fact, the length of credit history gets counted for every trade line on your report, regardless.
So, the only harm by closing a revolving account is to the utilization percentage, while, in the long run, a closed account will be removed from your credit file after 10 years, which could lower your score at that time due to the loss of that history.