As Dzug states, EU countries are obliged to give free passage to any EU citizen who can provide valid proof of thei citizenship. (Since the UK doesn't have ID cards yet, that means a current passport).
There are only a few countries where you have to have a certain length of time left on your passport when you enter. In every case this is to ensure that your passport will still be valid when you leave, even if your departure has been delayed by unforeseen circumstances (such as hospitalization). EU countries can't impose such conditions upon any EU citizen because you don't ever have to leave their country. (EU citizens have the automatic right to enter any other EU country, to live there and to work there. So immigration authorities can't impose rules related to your leaving date because you're not obliged to leave).
Your friend can arrive in Portugal one minute before midnight on the very last day of his passport's validity. The Portugese authorities would still have to admit him. They have no choice under EU law.
Chris