PHP Interface Yosymfony\Spress\Core\IO\IOInterface

Based on https://github.com/composer/composer/blob/master/src/Composer/IO/IOInterface.php from François Pluchino
Author: Victor Puertas
Afficher le fichier Open project: spress/spress Interface Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

ask() public méthode

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
Résultat string The user answer

askAndHideAnswer() public méthode

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
Résultat string The answer

askAndValidate() public méthode

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
Résultat mixed

askConfirmation() public méthode

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
Résultat boolean true if the user has confirmed, false otherwise

askHiddenResponseAndValidate() public méthode

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
Résultat mixed

isDebug() public méthode

Is the output in debug verbosity?
public isDebug ( ) : boolean
Résultat boolean

isDecorated() public méthode

Is this output decorated?
public isDecorated ( ) : boolean
Résultat boolean

isInteractive() public méthode

Is this input means interactive?
public isInteractive ( ) : boolean
Résultat boolean

isVerbose() public méthode

Is this output verbose?
public isVerbose ( ) : boolean
Résultat boolean

isVeryVerbose() public méthode

Is the output very verbose?
public isVeryVerbose ( ) : boolean
Résultat boolean

write() public méthode

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