Recently I had a problem with a running watch script on Bash on Ubuntu on Windows (the Windows Subsystem for Linux (WSL)) to compile SASS and saving of files in PhpStorm. PhpStorm showed an error message »Cannot save. The file is left unchanged« and created a temporary file with the changes.
I found the solution for that in the support forum from JetBrains. To solve the issue, just uncheck the box Use »Safe write« in the PhpStorms settings under File › Settings › Appearance & Behavior › System Settings.