library/VfsStreamWrapper.php
public function createFile($filePath, $content = '')
    {
        $this->createStructure([ltrim($filePath, '/') => $content]);
        return $this->getRootPath() . $filePath;
    }
public function createFile($filePath, $content = '')
    {
        $this->createStructure([ltrim($filePath, '/') => $content]);
        return $this->getRootPath() . $filePath;
    }
public function createFile ( $ filePath , $ content = '' ) { $ this -> createStructure ( [ ltrim ( $ filePath , '/' ) => $ content ] ) ; return $ this -> getRootPath ( ) . $ filePath ; }
Creates file with given content.
If file contains path, directories will also be created.
Creating multiple files in the same directory does not work as
parent directories gets cleared on creation.

NOTE: this can be used only once! If you call it twice,
the first file is gone and not found by is_file,
file_exists and others!

@param string $filePath
@param string $content  Will try to convent any value to string if non string is given.

@return string Path to created file.
Creates file with given content . If file contains path directories will also be created . Creating multiple files in the same directory does not work as parent directories gets cleared on creation .