PHP Класс Webmozart\Console\Api\IO\Output

This class wraps an output stream and adds convenience functionality for writing that stream.
С версии: 1.0
Автор: Bernhard Schussek ([email protected])
Наследование: implements Webmozart\Console\Api\Formatter\Formatter
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Webmozart\Console\Api\IO\OutputStream $stream, Webmozart\Console\Api\Formatter\Formatter $formatter = null ) Creates an output for the given output stream.
close ( ) Closes the output.
flush ( ) Forces all pending text to be written out.
format ( $string, Style $style = null )
getFormatter ( ) : Webmozart\Console\Api\Formatter\Formatter Returns the output formatter.
getStream ( ) : Webmozart\Console\Api\IO\OutputStream Returns the underlying stream.
getVerbosity ( ) : integer Returns the current verbosity level.
isClosed ( ) : boolean Returns whether the output is closed.
isDebug ( ) : boolean Returns whether the verbosity level is {@link IO::DEBUG}.
isQuiet ( ) : boolean Returns whether output is suppressed completely.
isVerbose ( ) : boolean Returns whether the verbosity level is {@link IO::VERBOSE} or greater.
isVeryVerbose ( ) : boolean Returns whether the verbosity level is {@link IO::VERY_VERBOSE} or greater.
removeFormat ( $string )
setFormatter ( Webmozart\Console\Api\Formatter\Formatter $formatter ) Sets the output formatter.
setQuiet ( boolean $quiet ) Sets whether output should be suppressed completely.
setStream ( Webmozart\Console\Api\IO\OutputStream $stream ) Sets the underlying stream.
setVerbosity ( integer $verbosity ) Sets the verbosity level of the output.
write ( string $string, integer $flags = null ) Writes a string to the output stream.
writeLine ( string $string, integer $flags = null ) Writes a line of text to the output stream.
writeLineRaw ( string $string, integer $flags = null ) Writes a line of text to the output stream without formatting.
writeRaw ( string $string, integer $flags = null ) Writes a string to the output stream without formatting.

Защищенные методы

Метод Описание
mayWrite ( integer $flags ) : boolean Returns whether an output may be written for the given flags.

Описание методов

__construct() публичный Метод

Creates an output for the given output stream.
public __construct ( Webmozart\Console\Api\IO\OutputStream $stream, Webmozart\Console\Api\Formatter\Formatter $formatter = null )
$stream Webmozart\Console\Api\IO\OutputStream The output stream.
$formatter Webmozart\Console\Api\Formatter\Formatter The formatter for formatting text written to the output stream.

close() публичный Метод

Closes the output.
public close ( )

flush() публичный Метод

Forces all pending text to be written out.
public flush ( )

format() публичный Метод

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

getFormatter() публичный Метод

Returns the output formatter.
public getFormatter ( ) : Webmozart\Console\Api\Formatter\Formatter
Результат Webmozart\Console\Api\Formatter\Formatter The output formatter.

getStream() публичный Метод

Returns the underlying stream.
public getStream ( ) : Webmozart\Console\Api\IO\OutputStream
Результат Webmozart\Console\Api\IO\OutputStream The output stream.

getVerbosity() публичный Метод

Returns the current verbosity level.
public getVerbosity ( ) : integer
Результат integer One of the verbosity constants.

isClosed() публичный Метод

Returns whether the output is closed.
public isClosed ( ) : boolean
Результат boolean Returns `true` if the output is closed and `false` otherwise.

isDebug() публичный Метод

Returns whether the verbosity level is {@link IO::DEBUG}.
public isDebug ( ) : boolean
Результат boolean Returns `true` if the verbosity level is {@link IO::DEBUG} and `false` otherwise.

isQuiet() публичный Метод

Returns whether output is suppressed completely.
public isQuiet ( ) : boolean
Результат boolean Returns `true` if all output is suppressed and `false` otherwise.

isVerbose() публичный Метод

Returns whether the verbosity level is {@link IO::VERBOSE} or greater.
public isVerbose ( ) : boolean
Результат boolean Returns `true` if the verbosity level is {@link IO::VERBOSE} or greater and `false` otherwise.

isVeryVerbose() публичный Метод

Returns whether the verbosity level is {@link IO::VERY_VERBOSE} or greater.
public isVeryVerbose ( ) : boolean
Результат boolean Returns `true` if the verbosity level is {@link IO::VERY_VERBOSE} or greater and `false` otherwise.

mayWrite() защищенный Метод

Returns whether an output may be written for the given flags.
protected mayWrite ( integer $flags ) : boolean
$flags integer The flags.
Результат boolean Returns `true` if the output may be written and `false` otherwise.

removeFormat() публичный Метод

public removeFormat ( $string )

setFormatter() публичный Метод

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

setQuiet() публичный Метод

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

setStream() публичный Метод

Sets the underlying stream.
public setStream ( Webmozart\Console\Api\IO\OutputStream $stream )
$stream Webmozart\Console\Api\IO\OutputStream The output stream.

setVerbosity() публичный Метод

Sets the verbosity level 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 written out.

write() публичный Метод

The string is formatted before it is written to the output stream.
public write ( string $string, integer $flags = null )
$string string The string to write.
$flags integer The flags. If one of of {@link IO::VERBOSE}, {@link IO::VERY_VERBOSE} and {@link IO::DEBUG} is passed, the output is only written if the verbosity level is the given level or higher.

writeLine() публичный Метод

The string is formatted before it is written to the output stream.
public writeLine ( string $string, integer $flags = null )
$string string The string to write. A newline is appended.
$flags integer The flags. If one of of {@link IO::VERBOSE}, {@link IO::VERY_VERBOSE} and {@link IO::DEBUG} is passed, the output is only written if the verbosity level is the given level or higher.

writeLineRaw() публичный Метод

Writes a line of text to the output stream without formatting.
public writeLineRaw ( string $string, integer $flags = null )
$string string The string to write. A newline is appended.
$flags integer The flags. If one of of {@link IO::VERBOSE}, {@link IO::VERY_VERBOSE} and {@link IO::DEBUG} is passed, the output is only written if the verbosity level is the given level or higher.

writeRaw() публичный Метод

Writes a string to the output stream without formatting.
public writeRaw ( string $string, integer $flags = null )
$string string The string to write.
$flags integer The flags. If one of of {@link IO::VERBOSE}, {@link IO::VERY_VERBOSE} and {@link IO::DEBUG} is passed, the output is only written if the verbosity level is the given level or higher.