src/Diagnostics/ContentWriter.php
public function saveTemp()
    {
        $this->tempPath = $this->createTempFile();
        if (is_writable($this->getTempPath())) {
            $result = file_put_contents($this->getTempPath(), $this->getContent());
            if (false === $result) {
                throw new SdkException('Unable to put content into temp file: ' . $this->getTempPath());
            }
            if (empty($result)) {
                throw new SdkException('Empty or zero file was received: ' . $this->getTempPath());
            }
            $this->bytes = $result;
            return true;
        }

        throw new SdkException('Unable to write temp file: ' . $this->tempPath);
    }
public function saveTemp()
    {
        $this->tempPath = $this->createTempFile();
        if (is_writable($this->getTempPath())) {
            $result = file_put_contents($this->getTempPath(), $this->getContent());
            if (false === $result) {
                throw new SdkException('Unable to put content into temp file: ' . $this->getTempPath());
            }
            if (empty($result)) {
                throw new SdkException('Empty or zero file was received: ' . $this->getTempPath());
            }
            $this->bytes = $result;
            return true;
        }

        throw new SdkException('Unable to write temp file: ' . $this->tempPath);
    }
Writes content into temporary file. It always creates new temp file.
Use getTempPath() to retrieve actual path.
This method doesn't delete the file after script termination.
@return boolean
@throws SdkException