When using Cloud IDE, you'll face issue when editing PHP files because of the auto-formatting that occurs when start writing PHP code. The auto-formatting will often indent lines and break up PHP code further down in the file and cause issues and you have to undo these changes.
You can turn-off this auto indentation feature under Settings -> Preferences -> Editor -> Auto Indent.
Set it to none and then save your changes, using the method based on your operating system:
macOS: Press Command+S.
Windows: Press Control+S.
Linux: Press Control+S.
The preferences are taken up immediately, but if not, then please close the IDE and start it again.
Please contact Acquia Support, if issue still persists for you.