PHP Class Phrozn\Runner\CommandLine\Reader

Author: Victor Farazdagi
Inheritance: implements Phrozn\Has\Outputter
Exibir arquivo Open project: farazdagi/phrozn Class Usage Examples

Public Methods

Method Description
__construct ( resource $handle = null, $outputter = null ) : void Setup reader
__destruct ( )
getHandle ( ) : resource Get input handle
getOutputter ( ) : Phrozn\Outputter Get outputter instance
readLine ( string $prompt ) : string Get line from standard input
setHandle ( resource $handle ) : Reader Set input handle
setOutputter ( Phrozn\Outputter $outputter ) : Phrozn\Has\Outputter Set outputter

Method Details

__construct() public method

Setup reader
public __construct ( resource $handle = null, $outputter = null ) : void
$handle resource STDIN if not set, parametrized for flexibility during testing
return void

__destruct() public method

public __destruct ( )

getHandle() public method

Get input handle
public getHandle ( ) : resource
return resource

getOutputter() public method

Get outputter instance
public getOutputter ( ) : Phrozn\Outputter
return Phrozn\Outputter

readLine() public method

Get line from standard input
public readLine ( string $prompt ) : string
$prompt string Input prompt
return string

setHandle() public method

Set input handle
public setHandle ( resource $handle ) : Reader
$handle resource Resource pointer
return Reader

setOutputter() public method

Set outputter
public setOutputter ( Phrozn\Outputter $outputter ) : Phrozn\Has\Outputter
$outputter Phrozn\Outputter Outputter instance
return Phrozn\Has\Outputter