PHP Class Webmozart\Console\Api\IO\IO

Since: 1.0
Author: Bernhard Schussek ([email protected])
Inheritance: implements Webmozart\Console\Api\Formatter\Formatter
Afficher le fichier Open project: webmozart/console Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( Input $input, Output $output, Output $errorOutput ) Creates an I/O based on the given input and outputs.
close ( ) Closes the input and the outputs.
error ( string $string, integer $flags = null ) Writes a string to the error output.
errorLine ( string $string, integer $flags = null ) Writes a line of text to the error output.
errorLineRaw ( string $string, integer $flags = null ) Writes a line of text to the error output without formatting.
errorRaw ( string $string, integer $flags = null ) Writes a string to the error output without formatting.
flush ( ) Flushes the outputs and forces all pending text to be written out.
format ( $string, Style $style = null )
getErrorOutput ( ) : Output Returns the error output.
getFormatter ( ) : Webmozart\Console\Api\Formatter\Formatter Returns the output formatter.
getInput ( ) : Input Returns the standard input.
getOutput ( ) : Output Returns the standard output.
getTerminalDimensions ( ) : Rectangle Returns the dimensions of the terminal.
getVerbosity ( ) : integer Returns the current verbosity level.
isDebug ( ) : boolean Returns whether the verbosity is {@link DEBUG}.
isInteractive ( ) : boolean Returns whether the user may be asked for input.
isQuiet ( ) : boolean Returns whether all output is suppressed.
isVerbose ( ) : boolean Returns whether the verbosity is {@link VERBOSE} or greater.
isVeryVerbose ( ) : boolean Returns whether the verbosity is {@link VERY_VERBOSE} or greater.
read ( integer $length, string $default = null ) : string Reads the given amount of characters from the standard input.
readLine ( string $default = null, integer $length = null ) : string Reads a line from the standard input.
removeFormat ( $string )
setFormatter ( Webmozart\Console\Api\Formatter\Formatter $formatter ) Sets the output formatter.
setInteractive ( boolean $interactive ) Enables or disables interaction with the user.
setQuiet ( boolean $quiet ) Sets whether all output should be suppressed.
setTerminalDimensions ( Rectangle $dimensions ) Sets the dimensions of the terminal.
setVerbosity ( integer $verbosity ) Sets the verbosity of the output.
write ( string $string, integer $flags = null ) Writes a string to the standard output.
writeLine ( string $string, integer $flags = null ) Writes a line of text to the standard output.
writeLineRaw ( string $string, integer $flags = null ) Writes a line of text to the standard output without formatting.
writeRaw ( string $string, integer $flags = null ) Writes a string to the standard output without formatting.

Méthodes protégées

Méthode Description
getDefaultTerminalDimensions ( ) : Rectangle Returns the default terminal dimensions.

Method Details

__construct() public méthode

Creates an I/O based on the given input and outputs.
public __construct ( Input $input, Output $output, Output $errorOutput )
$input Input The standard input.
$output Output The standard output.
$errorOutput Output The error output.

close() public méthode

Closes the input and the outputs.
public close ( )

error() public méthode

The string is formatted before it is written to the output.
public error ( string $string, integer $flags = null )
$string string The string to write.
$flags integer The flags. One of {@link VERBOSE}, {@link VERY_VERBOSE} and {@link DEBUG}.

errorLine() public méthode

The string is formatted before it is written to the output.
public errorLine ( string $string, integer $flags = null )
$string string The string to write. A newline is appended.
$flags integer The flags. One of {@link VERBOSE}, {@link VERY_VERBOSE} and {@link DEBUG}.

errorLineRaw() public méthode

Writes a line of text to the error output without formatting.
public errorLineRaw ( string $string, integer $flags = null )
$string string The string to write. A newline is appended.
$flags integer The flags. One of {@link VERBOSE}, {@link VERY_VERBOSE} and {@link DEBUG}.

errorRaw() public méthode

Writes a string to the error output without formatting.
public errorRaw ( string $string, integer $flags = null )
$string string The string to write.
$flags integer The flags. One of {@link VERBOSE}, {@link VERY_VERBOSE} and {@link DEBUG}.

flush() public méthode

Flushes the outputs and forces all pending text to be written out.
public flush ( )

format() public méthode

public format ( $string, Style $style = null )
$style Webmozart\Console\Api\Formatter\Style

getDefaultTerminalDimensions() protected méthode

Returns the default terminal dimensions.
protected getDefaultTerminalDimensions ( ) : Rectangle
Résultat Webmozart\Console\UI\Rectangle The terminal dimensions.

getErrorOutput() public méthode

Returns the error output.
public getErrorOutput ( ) : Output
Résultat Output The error output.

getFormatter() public méthode

Returns the output formatter.
public getFormatter ( ) : Webmozart\Console\Api\Formatter\Formatter
Résultat Webmozart\Console\Api\Formatter\Formatter The output formatter.

getInput() public méthode

Returns the standard input.
public getInput ( ) : Input
Résultat Input The input.

getOutput() public méthode

Returns the standard output.
public getOutput ( ) : Output
Résultat Output The output.

getTerminalDimensions() public méthode

Returns the dimensions of the terminal.
public getTerminalDimensions ( ) : Rectangle
Résultat Webmozart\Console\UI\Rectangle The terminal dimensions.

getVerbosity() public méthode

Returns the current verbosity level.
public getVerbosity ( ) : integer
Résultat integer One of the verbosity constants.

isDebug() public méthode

Returns whether the verbosity is {@link DEBUG}.
public isDebug ( ) : boolean
Résultat boolean Returns `true` if the verbosity is {@link DEBUG} and `false` otherwise.

isInteractive() public méthode

Returns whether the user may be asked for input.
public isInteractive ( ) : boolean
Résultat boolean Returns `true` if the user may be asked for input and `false` otherwise.

isQuiet() public méthode

Returns whether all output is suppressed.
public isQuiet ( ) : boolean
Résultat boolean Returns `true` if all output is suppressed and `false` otherwise.

isVerbose() public méthode

Returns whether the verbosity is {@link VERBOSE} or greater.
public isVerbose ( ) : boolean
Résultat boolean Returns `true` if the verbosity is {@link VERBOSE} or greater and `false` otherwise.

isVeryVerbose() public méthode

Returns whether the verbosity is {@link VERY_VERBOSE} or greater.
public isVeryVerbose ( ) : boolean
Résultat boolean Returns `true` if the verbosity is {@link VERY_VERBOSE} or greater and `false` otherwise.

read() public méthode

Reads the given amount of characters from the standard input.
public read ( integer $length, string $default = null ) : string
$length integer The number of characters to read.
$default string The default to return if interaction is disabled.
Résultat string The characters read from the input.

readLine() public méthode

Reads a line from the standard input.
public readLine ( string $default = null, integer $length = null ) : string
$default string The default to return if interaction is disabled.
$length integer The maximum number of characters to read. If `null`, all characters up to the first newline are returned.
Résultat string The characters read from the input.

removeFormat() public méthode

public removeFormat ( $string )

setFormatter() public méthode

Sets the output formatter.
public setFormatter ( Webmozart\Console\Api\Formatter\Formatter $formatter )
$formatter Webmozart\Console\Api\Formatter\Formatter The output formatter.

setInteractive() public méthode

Enables or disables interaction with the user.
public setInteractive ( boolean $interactive )
$interactive boolean Whether the I/O may interact with the user. If set to `false`, all calls to {@link read()} and {@link readLine()} will immediately return the default value.

setQuiet() public méthode

Sets whether all output should be suppressed.
public setQuiet ( boolean $quiet )
$quiet boolean Pass `true` to suppress all output and `false` otherwise.

setTerminalDimensions() public méthode

Sets the dimensions of the terminal.
public setTerminalDimensions ( Rectangle $dimensions )
$dimensions Webmozart\Console\UI\Rectangle The terminal dimensions.

setVerbosity() public méthode

Sets the verbosity of the output.
public setVerbosity ( integer $verbosity )
$verbosity integer One of the constants {@link NORMAL}, {@link VERBOSE}, {@link VERY_VERBOSE} or {@link DEBUG}. Only output with the given verbosity level or smaller will be passed through.

write() public méthode

The string is formatted before it is written to the output.
public write ( string $string, integer $flags = null )
$string string The string to write.
$flags integer The flags. One of {@link VERBOSE}, {@link VERY_VERBOSE} and {@link DEBUG}.

writeLine() public méthode

The string is formatted before it is written to the output.
public writeLine ( string $string, integer $flags = null )
$string string The string to write. A newline is appended.
$flags integer The flags. One of {@link VERBOSE}, {@link VERY_VERBOSE} and {@link DEBUG}.

writeLineRaw() public méthode

Writes a line of text to the standard output without formatting.
public writeLineRaw ( string $string, integer $flags = null )
$string string The string to write. A newline is appended.
$flags integer The flags. One of {@link VERBOSE}, {@link VERY_VERBOSE} and {@link DEBUG}.

writeRaw() public méthode

Writes a string to the standard output without formatting.
public writeRaw ( string $string, integer $flags = null )
$string string The string to write.
$flags integer The flags. One of {@link VERBOSE}, {@link VERY_VERBOSE} and {@link DEBUG}.