What is the alternative to file_unmanaged_save_data()?
Drupal always documents all the methods using ::, so you need to look closer as to whether the method is static or not.
So if you look at FileSystem::saveData



Its public and not a static. Therefore using ::saveData() is incorrect, needs to be called with the arrow -&gt;saveData()
Also, as pointed out, you need to call it with a class that implements the FileSystemInterface.