Method | Description | |
---|---|---|
__construct ( Webmozart\Console\Api\IO\InputStream $stream ) | Creates an input for the given input stream. | |
close ( ) | Closes the input. | |
getStream ( ) : Webmozart\Console\Api\IO\InputStream | Returns the underlying stream. | |
isClosed ( ) : boolean | Returns whether the input is closed. | |
isInteractive ( ) : boolean | Returns whether the user may be asked for input. | |
read ( integer $length, string $default = null ) : string | Reads the given amount of characters from the input stream. | |
readLine ( string $default = null, integer $length = null ) : string | Reads a line from the input stream. | |
setInteractive ( boolean $interactive ) | Enables or disables interaction with the user. | |
setStream ( Webmozart\Console\Api\IO\InputStream $stream ) | Sets the underlying stream. |
public __construct ( Webmozart\Console\Api\IO\InputStream $stream ) | ||
$stream | Webmozart\Console\Api\IO\InputStream | The input stream. |
public getStream ( ) : Webmozart\Console\Api\IO\InputStream | ||
return | Webmozart\Console\Api\IO\InputStream | The input stream. |
public isInteractive ( ) : boolean | ||
return | boolean | Returns `true` if the user may be asked for input and `false` otherwise. |
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. |
return | string | The characters read from the input stream. |
public setInteractive ( boolean $interactive ) | ||
$interactive | boolean | Whether the inputmay interact with the user. If set to `false`, all calls to {@link read()} and {@link readLine()} will immediately return the default value. |
public setStream ( Webmozart\Console\Api\IO\InputStream $stream ) | ||
$stream | Webmozart\Console\Api\IO\InputStream | The input stream. |