PHP 클래스 pho\Console\Console

파일 보기 프로젝트 열기: danielstjules/pho 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$formatter
$options

공개 메소드들

메소드 설명
__construct ( array $arguments, string $stream ) The constructor stores the arguments to be parsed, and creates instances of both ConsoleFormatter and ConsoleOptionParser. Also, if either a test or spec directory exists, they are set as the default paths to traverse.
getExitStatus ( ) : mixed Returns the error status that should be used to exit after parsing, otherwise it returns null.
getPaths ( ) : array Returns an array of strings corresponding to file and directory paths to be traversed.
getReporterClass ( ) : string Returns the namespaced name of the reporter class requested via the command line arguments, defaulting to DotReporter if not specified.
parseArguments ( ) Parses the arguments originally supplied via the constructor, assigning their values to the option keys in the $options array. If the arguments included the help or version option, the corresponding text is printed.
setExitStatus ( integer $exitStatus ) Sets the error code to be returned.
write ( string $string ) Outputs a single line, replacing all occurrences of the newline character in the string with PHP_EOL for cross-platform support.
writeLn ( string $string ) Outputs a line, followed by a newline, while replacing all occurrences of '\n' in the string with PHP_EOL for cross-platform support.

비공개 메소드들

메소드 설명
printHelp ( ) Outputs the help text, as required when the --help/-h flag is used. It's done by iterating over $this->availableOptions.
printVersion ( ) Outputs the version information, as defined in the VERSION constant.

메소드 상세

__construct() 공개 메소드

The constructor stores the arguments to be parsed, and creates instances of both ConsoleFormatter and ConsoleOptionParser. Also, if either a test or spec directory exists, they are set as the default paths to traverse.
public __construct ( array $arguments, string $stream )
$arguments array An array of argument strings
$stream string The I/O stream to use when writing

getExitStatus() 공개 메소드

Returns the error status that should be used to exit after parsing, otherwise it returns null.
public getExitStatus ( ) : mixed
리턴 mixed An integer error status, or null

getPaths() 공개 메소드

Returns an array of strings corresponding to file and directory paths to be traversed.
public getPaths ( ) : array
리턴 array An array of paths

getReporterClass() 공개 메소드

Returns the namespaced name of the reporter class requested via the command line arguments, defaulting to DotReporter if not specified.
public getReporterClass ( ) : string
리턴 string The namespaced class name of the reporter

parseArguments() 공개 메소드

Furthermore, if the arguments included a non-valid flag or option, or if any of the listed paths were invalid, error message is printed.
public parseArguments ( )

setExitStatus() 공개 메소드

Sets the error code to be returned.
public setExitStatus ( integer $exitStatus )
$exitStatus integer An integer return code or exit status

write() 공개 메소드

Outputs a single line, replacing all occurrences of the newline character in the string with PHP_EOL for cross-platform support.
public write ( string $string )
$string string The string to print

writeLn() 공개 메소드

Outputs a line, followed by a newline, while replacing all occurrences of '\n' in the string with PHP_EOL for cross-platform support.
public writeLn ( string $string )
$string string The string to print

프로퍼티 상세

$formatter 공개적으로 프로퍼티

public $formatter

$options 공개적으로 프로퍼티

public $options