ConsoleIO
extends BaseIO
in package
The Input/Output helper.
Tags
Table of Contents
- $authentications : mixed
- $helperSet : HelperSet
- $input : InputInterface
- $lastMessage : string
- $lastMessageErr : string
- $output : OutputInterface
- $startTime : float
- $verbosityMap : array<int, int>
- __construct() : mixed
- Constructor.
- alert() : null
- Action must be taken immediately.
- ask() : mixed
- {@inheritDoc}
- askAndHideAnswer() : mixed
- {@inheritDoc}
- askAndValidate() : mixed
- {@inheritDoc}
- askConfirmation() : mixed
- {@inheritDoc}
- critical() : null
- Critical conditions.
- debug() : null
- Detailed debug information.
- emergency() : null
- System is unusable.
- enableDebugging() : mixed
- error() : null
- Runtime errors that do not require immediate action but should typically be logged and monitored.
- getAuthentication() : array<string|int, mixed>
- Get the username and password of repository.
- getAuthentications() : array<string|int, mixed>
- Get all authentication information entered.
- hasAuthentication() : bool
- Verify if the repository has a authentication information.
- info() : null
- Interesting events.
- isDebug() : mixed
- {@inheritDoc}
- isDecorated() : mixed
- {@inheritDoc}
- isInteractive() : mixed
- {@inheritDoc}
- isVerbose() : mixed
- {@inheritDoc}
- isVeryVerbose() : mixed
- {@inheritDoc}
- loadConfiguration() : mixed
- Loads authentications from a config instance
- log() : null
- Logs with an arbitrary level.
- notice() : null
- Normal but significant events.
- overwrite() : mixed
- {@inheritDoc}
- overwriteError() : mixed
- {@inheritDoc}
- resetAuthentications() : mixed
- {@inheritDoc}
- select() : mixed
- {@inheritDoc}
- setAuthentication() : mixed
- Set the authentication information for the repository.
- warning() : null
- Exceptional occurrences that are not errors.
- write() : mixed
- {@inheritDoc}
- writeError() : mixed
- {@inheritDoc}
- writeErrorRaw() : mixed
- {@inheritDoc}
- writeRaw() : mixed
- {@inheritDoc}
- checkAndSetAuthentication() : mixed
- Check for overwrite and set the authentication information for the repository.
- doOverwrite() : mixed
- doWrite() : mixed
- getErrorOutput() : OutputInterface
Properties
$authentications
protected
mixed
$authentications
= array()
$helperSet
protected
HelperSet
$helperSet
$input
protected
InputInterface
$input
$lastMessage
protected
string
$lastMessage
$lastMessageErr
protected
string
$lastMessageErr
$output
protected
OutputInterface
$output
$startTime
private
float
$startTime
$verbosityMap
private
array<int, int>
$verbosityMap
Methods
__construct()
Constructor.
public
__construct(InputInterface $input, OutputInterface $output, HelperSet $helperSet) : mixed
Parameters
- $input : InputInterface
-
The input instance
- $output : OutputInterface
-
The output instance
- $helperSet : HelperSet
-
The helperSet instance
Return values
mixed —alert()
Action must be taken immediately.
public
alert(string $message[, array<string|int, mixed> $context = array() ]) : null
Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.
Parameters
- $message : string
- $context : array<string|int, mixed> = array()
Return values
null —ask()
{@inheritDoc}
public
ask(mixed $question[, mixed $default = null ]) : mixed
Parameters
- $question : mixed
- $default : mixed = null
Return values
mixed —askAndHideAnswer()
{@inheritDoc}
public
askAndHideAnswer(mixed $question) : mixed
Parameters
- $question : mixed
Return values
mixed —askAndValidate()
{@inheritDoc}
public
askAndValidate(mixed $question, mixed $validator[, mixed $attempts = null ][, mixed $default = null ]) : mixed
Parameters
- $question : mixed
- $validator : mixed
- $attempts : mixed = null
- $default : mixed = null
Return values
mixed —askConfirmation()
{@inheritDoc}
public
askConfirmation(mixed $question[, mixed $default = true ]) : mixed
Parameters
- $question : mixed
- $default : mixed = true
Return values
mixed —critical()
Critical conditions.
public
critical(string $message[, array<string|int, mixed> $context = array() ]) : null
Example: Application component unavailable, unexpected exception.
Parameters
- $message : string
- $context : array<string|int, mixed> = array()
Return values
null —debug()
Detailed debug information.
public
debug(string $message[, array<string|int, mixed> $context = array() ]) : null
Parameters
- $message : string
- $context : array<string|int, mixed> = array()
Return values
null —emergency()
System is unusable.
public
emergency(string $message[, array<string|int, mixed> $context = array() ]) : null
Parameters
- $message : string
- $context : array<string|int, mixed> = array()
Return values
null —enableDebugging()
public
enableDebugging(float $startTime) : mixed
Parameters
- $startTime : float
Return values
mixed —error()
Runtime errors that do not require immediate action but should typically be logged and monitored.
public
error(string $message[, array<string|int, mixed> $context = array() ]) : null
Parameters
- $message : string
- $context : array<string|int, mixed> = array()
Return values
null —getAuthentication()
Get the username and password of repository.
public
getAuthentication(mixed $repositoryName) : array<string|int, mixed>
Parameters
- $repositoryName : mixed
-
The unique name of repository
Return values
array<string|int, mixed> —The 'username' and 'password'
getAuthentications()
Get all authentication information entered.
public
getAuthentications() : array<string|int, mixed>
Return values
array<string|int, mixed> —The map of authentication data
hasAuthentication()
Verify if the repository has a authentication information.
public
hasAuthentication(mixed $repositoryName) : bool
Parameters
- $repositoryName : mixed
-
The unique name of repository
Return values
bool —info()
Interesting events.
public
info(string $message[, array<string|int, mixed> $context = array() ]) : null
Example: User logs in, SQL logs.
Parameters
- $message : string
- $context : array<string|int, mixed> = array()
Return values
null —isDebug()
{@inheritDoc}
public
isDebug() : mixed
Return values
mixed —isDecorated()
{@inheritDoc}
public
isDecorated() : mixed
Return values
mixed —isInteractive()
{@inheritDoc}
public
isInteractive() : mixed
Return values
mixed —isVerbose()
{@inheritDoc}
public
isVerbose() : mixed
Return values
mixed —isVeryVerbose()
{@inheritDoc}
public
isVeryVerbose() : mixed
Return values
mixed —loadConfiguration()
Loads authentications from a config instance
public
loadConfiguration(Config $config) : mixed
Parameters
- $config : Config
Return values
mixed —log()
Logs with an arbitrary level.
public
log(mixed $level, string $message[, array<string|int, mixed> $context = array() ]) : null
Parameters
- $level : mixed
- $message : string
- $context : array<string|int, mixed> = array()
Return values
null —notice()
Normal but significant events.
public
notice(string $message[, array<string|int, mixed> $context = array() ]) : null
Parameters
- $message : string
- $context : array<string|int, mixed> = array()
Return values
null —overwrite()
{@inheritDoc}
public
overwrite(mixed $messages[, mixed $newline = true ][, mixed $size = null ][, mixed $verbosity = self::NORMAL ]) : mixed
Parameters
- $messages : mixed
- $newline : mixed = true
- $size : mixed = null
- $verbosity : mixed = self::NORMAL
Return values
mixed —overwriteError()
{@inheritDoc}
public
overwriteError(mixed $messages[, mixed $newline = true ][, mixed $size = null ][, mixed $verbosity = self::NORMAL ]) : mixed
Parameters
- $messages : mixed
- $newline : mixed = true
- $size : mixed = null
- $verbosity : mixed = self::NORMAL
Return values
mixed —resetAuthentications()
{@inheritDoc}
public
resetAuthentications() : mixed
Return values
mixed —select()
{@inheritDoc}
public
select(mixed $question, mixed $choices, mixed $default[, mixed $attempts = false ][, mixed $errorMessage = 'Value "%s" is invalid' ][, mixed $multiselect = false ]) : mixed
Parameters
- $question : mixed
- $choices : mixed
- $default : mixed
- $attempts : mixed = false
- $errorMessage : mixed = 'Value "%s" is invalid'
- $multiselect : mixed = false
Return values
mixed —setAuthentication()
Set the authentication information for the repository.
public
setAuthentication(mixed $repositoryName, mixed $username[, mixed $password = null ]) : mixed
Parameters
- $repositoryName : mixed
-
The unique name of repository
- $username : mixed
-
The username
- $password : mixed = null
-
The password
Return values
mixed —warning()
Exceptional occurrences that are not errors.
public
warning(string $message[, array<string|int, mixed> $context = array() ]) : null
Example: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.
Parameters
- $message : string
- $context : array<string|int, mixed> = array()
Return values
null —write()
{@inheritDoc}
public
write(mixed $messages[, mixed $newline = true ][, mixed $verbosity = self::NORMAL ]) : mixed
Parameters
- $messages : mixed
- $newline : mixed = true
- $verbosity : mixed = self::NORMAL
Return values
mixed —writeError()
{@inheritDoc}
public
writeError(mixed $messages[, mixed $newline = true ][, mixed $verbosity = self::NORMAL ]) : mixed
Parameters
- $messages : mixed
- $newline : mixed = true
- $verbosity : mixed = self::NORMAL
Return values
mixed —writeErrorRaw()
{@inheritDoc}
public
writeErrorRaw(mixed $messages[, mixed $newline = true ][, mixed $verbosity = self::NORMAL ]) : mixed
Parameters
- $messages : mixed
- $newline : mixed = true
- $verbosity : mixed = self::NORMAL
Return values
mixed —writeRaw()
{@inheritDoc}
public
writeRaw(mixed $messages[, mixed $newline = true ][, mixed $verbosity = self::NORMAL ]) : mixed
Parameters
- $messages : mixed
- $newline : mixed = true
- $verbosity : mixed = self::NORMAL
Return values
mixed —checkAndSetAuthentication()
Check for overwrite and set the authentication information for the repository.
protected
checkAndSetAuthentication(string $repositoryName, string $username[, string $password = null ]) : mixed
Parameters
- $repositoryName : string
-
The unique name of repository
- $username : string
-
The username
- $password : string = null
-
The password
Return values
mixed —doOverwrite()
private
doOverwrite(array<string|int, mixed>|string $messages, bool $newline, int|null $size, bool $stderr, int $verbosity) : mixed
Parameters
- $messages : array<string|int, mixed>|string
- $newline : bool
- $size : int|null
- $stderr : bool
- $verbosity : int
Return values
mixed —doWrite()
private
doWrite(array<string|int, mixed>|string $messages, bool $newline, bool $stderr, int $verbosity[, mixed $raw = false ]) : mixed
Parameters
- $messages : array<string|int, mixed>|string
- $newline : bool
- $stderr : bool
- $verbosity : int
- $raw : mixed = false
Return values
mixed —getErrorOutput()
private
getErrorOutput() : OutputInterface