PHP Class Alex\BehatLauncher\Behat\OutputFile

Show file Open project: alexandresalome/behat-launcher

Public Methods

Method Description
__construct ( string $path = null, $id = null ) Constructs the output file.
append ( $content ) : OutputFile Appends a content to the file.
delete ( ) : OutputFile Deletes the file.
exists ( ) : boolean Tests if file exists.
getId ( ) : string
getMimetype ( ) : string
getPath ( ) : string
isEmpty ( )
moveTo ( string $path ) : OutputFile Moves the output file to a new location.
setContent ( string $content ) : OutputFile Changes the file content.
setId ( string $id ) : OutputFile
setPath ( string $path ) : OutputFile

Private Methods

Method Description
getOrCreatePath ( ) : string Prepares path for writing.

Method Details

__construct() public method

If no path is given, a temporary file will be created on first write.
public __construct ( string $path = null, $id = null )
$path string an absolute path

append() public method

Appends a content to the file.
public append ( $content ) : OutputFile
return OutputFile

delete() public method

Deletes the file.
public delete ( ) : OutputFile
return OutputFile

exists() public method

Tests if file exists.
public exists ( ) : boolean
return boolean

getId() public method

public getId ( ) : string
return string

getMimetype() public method

public getMimetype ( ) : string
return string

getPath() public method

public getPath ( ) : string
return string an absolute path

isEmpty() public method

public isEmpty ( )

moveTo() public method

Moves the output file to a new location.
public moveTo ( string $path ) : OutputFile
$path string an absolute path
return OutputFile

setContent() public method

Changes the file content.
public setContent ( string $content ) : OutputFile
$content string new content to set
return OutputFile

setId() public method

public setId ( string $id ) : OutputFile
$id string
return OutputFile

setPath() public method

public setPath ( string $path ) : OutputFile
$path string
return OutputFile