PHP 클래스 Phrozn\Runner\CommandLine\Callback\Base

저자: Victor Farazdagi
상속: implements Phrozn\Runner\CommandLine\Callback
파일 보기 프로젝트 열기: farazdagi/phrozn

공개 메소드들

메소드 설명
getConfig ( ) : array Get command config array
getOutputter ( ) : Console_CommandLine_Outputter Get CLI outputter
getParseResult ( ) : Console_CommandLine_Result Get parsed result object
out ( string $str ) : Phrozn\Runner\CommandLine\Callback Output string to stdout (flushes output). Wrapper around Outputter
readLine ( ) : string Read-line either from STDIN or mock unit test data
setConfig ( array $config ) : Phrozn\Runner\CommandLine\Callback Set config data for a given callback
setOutputter ( $out ) : Phrozn\Runner\CommandLine\Callback Set CLI outputter
setParseResult ( Console_CommandLine_Result $result ) : Phrozn\Runner\CommandLine\Callback Result object of CLI input parsing
setUnitTestData ( $data ) : Phrozn\Runner\CommandLine\Callback Since Unit Testing readline can be tricky, confirm answer is exposed to unit test via this method. Simply pass the string you want to be used in place of readline() result.

보호된 메소드들

메소드 설명
combine ( string $file, boolean $verbose = false ) : string Combine command documentation
getFooter ( ) : string Phrozn CLI footer
getHeader ( ) : string Phrozn CLI header
getPathArgument ( string $name, boolean $realpath = true, Console_CommandLine_Result $command = null ) : string Extract path argument or fallback to cwd
isAbsolute ( string $path ) : boolean See whether given path is absolute or relative
pad ( $str )
pre ( array $arr ) : string Prepend all lines in array with intendation

비공개 메소드들

메소드 설명
getCommandMeta ( )
getRealCommandName ( string $file ) : string Search if an alias exists for this command
useAnsiColors ( )

메소드 상세

combine() 보호된 메소드

Combine command documentation
protected combine ( string $file, boolean $verbose = false ) : string
$file string Command file to combine
$verbose boolean Whether to provide full documentation or just summary
리턴 string

getConfig() 공개 메소드

Get command config array
public getConfig ( ) : array
리턴 array

getFooter() 보호된 메소드

Phrozn CLI footer
protected getFooter ( ) : string
리턴 string

getHeader() 보호된 메소드

Phrozn CLI header
protected getHeader ( ) : string
리턴 string

getOutputter() 공개 메소드

Get CLI outputter
public getOutputter ( ) : Console_CommandLine_Outputter
리턴 Console_CommandLine_Outputter CLI outputter instance

getParseResult() 공개 메소드

Get parsed result object
public getParseResult ( ) : Console_CommandLine_Result
리턴 Console_CommandLine_Result

getPathArgument() 보호된 메소드

Extract path argument or fallback to cwd
protected getPathArgument ( string $name, boolean $realpath = true, Console_CommandLine_Result $command = null ) : string
$name string Name of the path argument
$realpath boolean Whether to apply realpath() to path
$command Console_CommandLine_Result Command line result to use
리턴 string

isAbsolute() 보호된 메소드

See whether given path is absolute or relative
protected isAbsolute ( string $path ) : boolean
$path string Path to check
리턴 boolean

out() 공개 메소드

Output string to stdout (flushes output). Wrapper around Outputter
public out ( string $str ) : Phrozn\Runner\CommandLine\Callback
$str string String to output
리턴 Phrozn\Runner\CommandLine\Callback

pad() 보호된 메소드

protected pad ( $str )

pre() 보호된 메소드

Prepend all lines in array with intendation
protected pre ( array $arr ) : string
$arr array Array to combine
리턴 string

readLine() 공개 메소드

Read-line either from STDIN or mock unit test data
public readLine ( ) : string
리턴 string

setConfig() 공개 메소드

Set config data for a given callback
public setConfig ( array $config ) : Phrozn\Runner\CommandLine\Callback
$config array Config array
리턴 Phrozn\Runner\CommandLine\Callback

setOutputter() 공개 메소드

Set CLI outputter
public setOutputter ( $out ) : Phrozn\Runner\CommandLine\Callback
리턴 Phrozn\Runner\CommandLine\Callback

setParseResult() 공개 메소드

Result object of CLI input parsing
public setParseResult ( Console_CommandLine_Result $result ) : Phrozn\Runner\CommandLine\Callback
$result Console_CommandLine_Result Parser's result
리턴 Phrozn\Runner\CommandLine\Callback

setUnitTestData() 공개 메소드

Since Unit Testing readline can be tricky, confirm answer is exposed to unit test via this method. Simply pass the string you want to be used in place of readline() result.
public setUnitTestData ( $data ) : Phrozn\Runner\CommandLine\Callback
리턴 Phrozn\Runner\CommandLine\Callback