Add initial implementation for php generator and refactor existing generators