[ClassLoader] fixed heredocs handling

The end of an hereodc must have a newline to avoid PHP syntax errors.