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
파일 보기 프로젝트 열기: webmozart/console 1 사용 예제들

공개 메소드들

메소드 설명
__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.