public function createFileWithContents($parentFolderPath, $fileName, $fileContents)
    {
        $this->throwIfOperationNotInBaseFolder($parentFolderPath);

        $filePath = $parentFolderPath . '/' . $fileName;

        $wasCreationSuccessful = file_put_contents($filePath, $fileContents);
        if ($wasCreationSuccessful === false) {
            throw new IOException("Unable to create file: $filePath");
        }

        return $filePath;
    }
public function createFileWithContents($parentFolderPath, $fileName, $fileContents)
    {
        $this->throwIfOperationNotInBaseFolder($parentFolderPath);

        $filePath = $parentFolderPath . '/' . $fileName;

        $wasCreationSuccessful = file_put_contents($filePath, $fileContents);
        if ($wasCreationSuccessful === false) {
            throw new IOException("Unable to create file: $filePath");
        }

        return $filePath;
    }
public function createFileWithContents ( $ parentFolderPath , $ fileName , $ fileContents ) { $ this -> throwIfOperationNotInBaseFolder ( $ parentFolderPath ) ; $ filePath = $ parentFolderPath . '/' . $ fileName ; $ wasCreationSuccessful = file_put_contents ( $ filePath , $ fileContents ) ; if ( $ wasCreationSuccessful === false ) { throw new IOException ( "Unable to create file: $filePath" ) ; } return $ filePath ; }
Creates a file with the given name and content in the given folder.
The parent folder must exist.

@param string $parentFolderPath The parent folder path where the file is going to be created
@param string $fileName The name of the file to create
@param string $fileContents The contents of the file to create
@return string Path of the created file
@throws \Box\Spout\Common\Exception\IOException If unable to create the file or if the file path is not inside of the base folder
Creates a file with the given name and content in the given folder . The parent folder must exist .