QUIET
QUIET = 1
The Input/Output helper interface.
write(string|array $messages, boolean $newline = true, integer $verbosity = self::NORMAL)
Writes a message to the output.
string|array | $messages | The message as an array of lines or a single string |
boolean | $newline | Whether to add a newline or not |
integer | $verbosity | Verbosity level from the VERBOSITY_* constants |
writeError(string|array $messages, boolean $newline = true, integer $verbosity = self::NORMAL)
Writes a message to the error output.
string|array | $messages | The message as an array of lines or a single string |
boolean | $newline | Whether to add a newline or not |
integer | $verbosity | Verbosity level from the VERBOSITY_* constants |
overwrite(string|array $messages, boolean $newline = true, integer $size = null, integer $verbosity = self::NORMAL)
Overwrites a previous message to the output.
string|array | $messages | The message as an array of lines or a single string |
boolean | $newline | Whether to add a newline or not |
integer | $size | The size of line |
integer | $verbosity | Verbosity level from the VERBOSITY_* constants |
overwriteError(string|array $messages, boolean $newline = true, integer $size = null, integer $verbosity = self::NORMAL)
Overwrites a previous message to the error output.
string|array | $messages | The message as an array of lines or a single string |
boolean | $newline | Whether to add a newline or not |
integer | $size | The size of line |
integer | $verbosity | Verbosity level from the VERBOSITY_* constants |
ask(string $question, string $default = null) : string
Asks a question to the user.
string | $question | The question to ask |
string | $default | The default answer if none is given by the user |
If there is no data to read in the input stream
The user answer
askConfirmation(string $question, boolean $default = true) : boolean
Asks a confirmation to the user.
The question will be asked until the user answers by nothing, yes, or no.
string | $question | The question to ask |
boolean | $default | The default answer if the user enters nothing |
true if the user has confirmed, false otherwise
askAndValidate(string $question, callable $validator, null|integer $attempts = null, mixed $default = null) : mixed
Asks for a value and validates the response.
The validator receives the data to validate. It must return the validated data when the data is valid and throw an exception otherwise.
string | $question | The question to ask |
callable | $validator | A PHP callback |
null|integer | $attempts | Max number of times to ask before giving up (default of null means infinite) |
mixed | $default | The default answer if none is given by the user |
When any of the validators return an error
select(string $question, array $choices, boolean|string $default, boolean|integer $attempts = false, string $errorMessage = 'Value "%s" is invalid', boolean $multiselect = false) : integer|string|array
Asks the user to select a value.
string | $question | The question to ask |
array | $choices | List of choices to pick from |
boolean|string | $default | The default answer if the user enters nothing |
boolean|integer | $attempts | Max number of times to ask before giving up (false by default, which means infinite) |
string | $errorMessage | Message which will be shown if invalid value from choice list would be picked |
boolean | $multiselect | Select more than one value separated by comma |
The selected value or values (the key of the choices array)
loadConfiguration(\Composer\Config $config)
Loads authentications from a config instance
\Composer\Config | $config |