private function createTempFile($name, $content)
    {
        $tempDir  = \sys_get_temp_dir();
        $fileName = \md5($name);
        $filePath = $tempDir . DIRECTORY_SEPARATOR . 'phpcq-author-validation' . DIRECTORY_SEPARATOR . $fileName;

        if (\file_exists($filePath)) {
            return $filePath;
        }

        if (!\file_exists(\dirname($filePath)) && !\mkdir($concurrentDirectory = \dirname($filePath))
            && !is_dir(
                $concurrentDirectory
            )) {
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory));
        }

        $file = \fopen($filePath, 'wb');

        \fwrite($file, $content);

        return $filePath;
    }
private function createTempFile($name, $content)
    {
        $tempDir  = \sys_get_temp_dir();
        $fileName = \md5($name);
        $filePath = $tempDir . DIRECTORY_SEPARATOR . 'phpcq-author-validation' . DIRECTORY_SEPARATOR . $fileName;

        if (\file_exists($filePath)) {
            return $filePath;
        }

        if (!\file_exists(\dirname($filePath)) && !\mkdir($concurrentDirectory = \dirname($filePath))
            && !is_dir(
                $concurrentDirectory
            )) {
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory));
        }

        $file = \fopen($filePath, 'wb');

        \fwrite($file, $content);

        return $filePath;
    }
private function createTempFile ( $ name , $ content ) { $ tempDir = \ sys_get_temp_dir ( ) ; $ fileName = \ md5 ( $ name ) ; $ filePath = $ tempDir . DIRECTORY_SEPARATOR . 'phpcq-author-validation' . DIRECTORY_SEPARATOR . $ fileName ; if ( \ file_exists ( $ filePath ) ) { return $ filePath ; } if ( ! \ file_exists ( \ dirname ( $ filePath ) ) && ! \ mkdir ( $ concurrentDirectory = \ dirname ( $ filePath ) ) && ! is_dir ( $ concurrentDirectory ) ) { throw new \ RuntimeException ( sprintf ( 'Directory "%s" was not created' , $ concurrentDirectory ) ) ; } $ file = \ fopen ( $ filePath , 'wb' ) ; \ fwrite ( $ file , $ content ) ; return $ filePath ; }
Create a temporary file.

@param string $name    The file name.
@param string $content The file content.

@return string

@throws \RuntimeException Throws an exception if the directory not created for the file.
Create a temporary file .