Don´t remember ever changing that before, but I suppose I must have done.
The PHP templates are the same for everyone and aren't changed at all.
There are two references to localhost in the templates:
#1 The dbconfig.xml.php -> You need to change that if the database is on a different machine than the website. If both are on the same server/virtual server/container, you don't have to change that. (Usually in a real life deployment you have the choice of pointing SAM to the database on your webhost or to point the website to the database on your Studio/SAM computer)
#2 The config.php -> You only need to change that if you want to use the requests feature and make sure to point that to the IP/DynDNS name of your SAM computer. (also make sure to forward port 1221 in your Router/NAT Gateway)