Update generate.php

Replace switch / case by if / else if