PHP 인터페이스 Yosymfony\Spress\Core\IO\IOInterface

Based on https://github.com/composer/composer/blob/master/src/Composer/IO/IOInterface.php from François Pluchino
저자: Victor Puertas
파일 보기 프로젝트 열기: spress/spress 0 사용 예제들

공개 메소드들

메소드 설명
ask ( string | array $question, string $default = null ) : string Asks a question to the user.
askAndHideAnswer ( string $question, boolean $fallback = true ) : string Asks a question to the user and hide the answer.
askAndValidate ( string | array $question, callable $validator, boolean | integer $attempts = false, string $default = null ) : mixed Asks for a value and validates the response.
askConfirmation ( string | array $question, boolean $default = true ) : boolean Asks a confirmation to the user.
askHiddenResponseAndValidate ( string | array $question, callable $validator, boolean | integer $attempts = false, boolean $fallback = true ) : mixed Asks for a value, hide and validates the response.
isDebug ( ) : boolean Is the output in debug verbosity?
isDecorated ( ) : boolean Is this output decorated?
isInteractive ( ) : boolean Is this input means interactive?
isVerbose ( ) : boolean Is this output verbose?
isVeryVerbose ( ) : boolean Is the output very verbose?
write ( string | array $messages, boolean $newline = true ) Writes a message to the output.

메소드 상세

ask() 공개 메소드

Asks a question to the user.
public ask ( string | array $question, string $default = null ) : string
$question string | array The question to ask
$default string The default answer if none is given by the user
리턴 string The user answer

askAndHideAnswer() 공개 메소드

Asks a question to the user and hide the answer.
public askAndHideAnswer ( string $question, boolean $fallback = true ) : string
$question string The question to ask
$fallback boolean In case the response can not be hidden, whether to fallback on non-hidden question or not
리턴 string The answer

askAndValidate() 공개 메소드

The validator receives the data to validate. It must return the validated data when the data is valid and throw an exception otherwise.
public askAndValidate ( string | array $question, callable $validator, boolean | integer $attempts = false, string $default = null ) : mixed
$question string | array The question to ask
$validator callable A PHP callback
$attempts boolean | integer Max number of times to ask before giving up (false by default, which means infinite)
$default string The default answer if none is given by the user
리턴 mixed

askConfirmation() 공개 메소드

The question will be asked until the user answers by nothing, yes, or no.
public askConfirmation ( string | array $question, boolean $default = true ) : boolean
$question string | array The question to ask
$default boolean The default answer if the user enters nothing
리턴 boolean true if the user has confirmed, false otherwise

askHiddenResponseAndValidate() 공개 메소드

The validator receives the data to validate. It must return the validated data when the data is valid and throw an exception otherwise.
public askHiddenResponseAndValidate ( string | array $question, callable $validator, boolean | integer $attempts = false, boolean $fallback = true ) : mixed
$question string | array The question to ask
$validator callable A PHP callback
$attempts boolean | integer Max number of times to ask before giving up (false by default, which means infinite)
$fallback boolean In case the response can not be hidden, whether to fallback on non-hidden question or not
리턴 mixed

isDebug() 공개 메소드

Is the output in debug verbosity?
public isDebug ( ) : boolean
리턴 boolean

isDecorated() 공개 메소드

Is this output decorated?
public isDecorated ( ) : boolean
리턴 boolean

isInteractive() 공개 메소드

Is this input means interactive?
public isInteractive ( ) : boolean
리턴 boolean

isVerbose() 공개 메소드

Is this output verbose?
public isVerbose ( ) : boolean
리턴 boolean

isVeryVerbose() 공개 메소드

Is the output very verbose?
public isVeryVerbose ( ) : boolean
리턴 boolean

write() 공개 메소드

Writes a message to the output.
public write ( string | array $messages, boolean $newline = true )
$messages string | array The message as an array of lines or a single string
$newline boolean Whether to add a newline or not