@ -66,56 +66,68 @@ interface IOInterface extends LoggerInterface
/**
* Writes a message to the output.
*
* @param string|array $messages The message as an array of lines or a single string
* @param string|string[] $messages The message as an array of lines or a single string
* @param bool $newline Whether to add a newline or not
* @param int $verbosity Verbosity level from the VERBOSITY_* constants
*
* @return void
*/
public function write($messages, $newline = true, $verbosity = self::NORMAL);
/**
* Writes a message to the error output.
*
* @param string|array $messages The message as an array of lines or a single string
* @param string|string[] $messages The message as an array of lines or a single string
* @param bool $newline Whether to add a newline or not
* @param int $verbosity Verbosity level from the VERBOSITY_* constants
*
* @return void
*/
public function writeError($messages, $newline = true, $verbosity = self::NORMAL);
/**
* Writes a message to the output, without formatting it.
*
* @param string|array $messages The message as an array of lines or a single string
* @param string|string[] $messages The message as an array of lines or a single string
* @param bool $newline Whether to add a newline or not
* @param int $verbosity Verbosity level from the VERBOSITY_* constants
*
* @return void
*/
public function writeRaw($messages, $newline = true, $verbosity = self::NORMAL);
/**
* Writes a message to the error output, without formatting it.
*
* @param string|array $messages The message as an array of lines or a single string
* @param string|string[] $messages The message as an array of lines or a single string
* @param bool $newline Whether to add a newline or not
* @param int $verbosity Verbosity level from the VERBOSITY_* constants
*
* @return void
*/
public function writeErrorRaw($messages, $newline = true, $verbosity = self::NORMAL);
/**
* Overwrites a previous message to the output.
*
* @param string|array $messages The message as an array of lines or a single string
* @param string|string[] $messages The message as an array of lines or a single string
* @param bool $newline Whether to add a newline or not
* @param int $size The size of line
* @param int $verbosity Verbosity level from the VERBOSITY_* constants
*
* @return void
*/
public function overwrite($messages, $newline = true, $size = null, $verbosity = self::NORMAL);
/**
* Overwrites a previous message to the error output.
*
* @param string|array $messages The message as an array of lines or a single string
* @param string|string[] $messages The message as an array of lines or a single string
* @param bool $newline Whether to add a newline or not
* @param int $size The size of line
* @param int $verbosity Verbosity level from the VERBOSITY_* constants
*
* @return void
*/
public function overwriteError($messages, $newline = true, $size = null, $verbosity = self::NORMAL);
@ -172,21 +184,21 @@ interface IOInterface extends LoggerInterface
* Asks the user to select a value.
*
* @param string $question The question to ask
* @param array $choices List of choices to pick from
* @param string[] $choices List of choices to pick from
* @param bool|string $default The default answer if the user enters nothing
* @param bool|int $attempts Max number of times to ask before giving up (false by default, which means infinite)
* @param string $errorMessage Message which will be shown if invalid value from choice list would be picked
* @param bool $multiselect Select more than one value separated by comma
*
* @throws \InvalidArgumentException
* @return int|string|array |bool The selected value or values (the key of the choices array)
* @return int|string|string[] |bool The selected value or values (the key of the choices array)
*/
public function select($question, $choices, $default, $attempts = false, $errorMessage = 'Value "%s" is invalid', $multiselect = false);
/**
* Get all authentication information entered.
*
* @return array The map of authentication data
* @return array< string , array { username: string , password: string } > The map of authentication data
*/
public function getAuthentications();
@ -204,7 +216,7 @@ interface IOInterface extends LoggerInterface
*
* @param string $repositoryName The unique name of repository
*
* @return array The 'username' and 'password'
* @return array{username: string|null, password: string|null}
*/
public function getAuthentication($repositoryName);
@ -213,7 +225,9 @@ interface IOInterface extends LoggerInterface
*
* @param string $repositoryName The unique name of repository
* @param string $username The username
* @param string $password The password
* @param ?string $password The password
*
* @return void
*/
public function setAuthentication($repositoryName, $username, $password = null);
@ -221,6 +235,8 @@ interface IOInterface extends LoggerInterface
* Loads authentications from a config instance
*
* @param Config $config
*
* @return void
*/
public function loadConfiguration(Config $config);
}