Property | Type | Description | |
---|---|---|---|
$dialogHelper | |||
$output | Symfony\Component\Console\Output\ConsoleOutput | ||
$progressHelper | Symfony\Component\Console\Helper\ProgressHelper | ||
$tableHelper | Symfony\Component\Console\Helper\TableHelper |
Method | Description | |
---|---|---|
__construct ( ) | Creates and initializes the SymfonyConsoleOutput instance | |
ask ( string | array $question, string $default = null, array $autocomplete = null ) : string | Asks a question to the user | |
askAndValidate ( string | array $question, callable $validator, integer | boolean $attempts = false, string $default = null, array $autocomplete = null ) : mixed | Asks for a value and validates the response | |
askConfirmation ( string | array $question, boolean $default = true ) : boolean | Asks a confirmation to the user. | |
askHiddenResponse ( string | array $question, boolean $fallback = true ) : string | Asks a question to the user, the response is hidden | |
askHiddenResponseAndValidate ( string | array $question, callable $validator, integer | boolean $attempts = false, boolean $fallback = true ) : string | Asks for a value, hide and validates the response | |
getMaximumLineLength ( ) : integer | Returns the desired maximum line length for console output. | |
output ( string $text, array $arguments = [] ) : void | Outputs specified text to the console window You can specify arguments that will be passed to the text via sprintf | |
outputFormatted ( string $text = '', array $arguments = [], integer $leftPadding ) : void | Formats the given text to fit into the maximum line length and outputs it to the console window | |
outputLine ( string $text = '', array $arguments = [] ) : void | Outputs specified text to the console window and appends a line break | |
outputTable ( array $rows, array $headers = null ) | Renders a table like output of the given $rows | |
progressAdvance ( integer $step = 1, boolean $redraw = false ) : void | Advances the progress output X steps | |
progressFinish ( ) : void | Finishes the progress output | |
progressSet ( integer $current, boolean $redraw = false ) : void | Sets the current progress | |
progressStart ( integer $max = null ) : void | Starts the progress output | |
select ( string | array $question, array $choices, boolean $default = null, boolean $multiSelect = false, boolean | integer $attempts = false ) : integer | string | array | Asks the user to select a value |
Method | Description | |
---|---|---|
getDialogHelper ( ) : |
Returns or initializes the symfony/console DialogHelper | |
getProgressHelper ( ) : Symfony\Component\Console\Helper\ProgressHelper | Returns or initializes the symfony/console ProgressHelper | |
getTableHelper ( ) : Symfony\Component\Console\Helper\TableHelper | Returns or initializes the symfony/console TableHelper |
public __construct ( ) |
public ask ( string | array $question, string $default = null, array $autocomplete = null ) : string | ||
$question | string | array | The question to ask. If an array each array item is turned into one line of a multi-line question |
$default | string | The default answer if none is given by the user |
$autocomplete | array | List of values to autocomplete. This only works if "stty" is installed |
return | string | The user answer |
public askAndValidate ( string | array $question, callable $validator, integer | boolean $attempts = false, string $default = null, array $autocomplete = null ) : mixed | ||
$question | string | array | The question to ask. If an array each array item is turned into one line of a multi-line question |
$validator | callable | A PHP callback that gets a value and is expected to return the (transformed) value or throw an exception if it wasn't valid |
$attempts | integer | boolean | Max number of times to ask before giving up (false by default, which means infinite) |
$default | string | The default answer if none is given by the user |
$autocomplete | array | List of values to autocomplete. This only works if "stty" is installed |
return | mixed |
public askConfirmation ( string | array $question, boolean $default = true ) : boolean | ||
$question | string | array | The question to ask. If an array each array item is turned into one line of a multi-line question |
$default | boolean | The default answer if the user enters nothing |
return | boolean | true if the user has confirmed, false otherwise |
public askHiddenResponse ( string | array $question, boolean $fallback = true ) : string | ||
$question | string | array | The question. If an array each array item is turned into one line of a multi-line question |
$fallback | boolean | In case the response can not be hidden, whether to fallback on non-hidden question or not |
return | string | The answer |
public askHiddenResponseAndValidate ( string | array $question, callable $validator, integer | boolean $attempts = false, boolean $fallback = true ) : string | ||
$question | string | array | The question to ask. If an array each array item is turned into one line of a multi-line question |
$validator | callable | A PHP callback that gets a value and is expected to return the (transformed) value or throw an exception if it wasn't valid |
$attempts | integer | boolean | Max number of times to ask before giving up (false by default, which means infinite) |
$fallback | boolean | In case the response can not be hidden, whether to fallback on non-hidden question or not |
return | string | The response |
protected getDialogHelper ( ) : |
||
return |
public getMaximumLineLength ( ) : integer | ||
return | integer |
protected getProgressHelper ( ) : Symfony\Component\Console\Helper\ProgressHelper | ||
return | Symfony\Component\Console\Helper\ProgressHelper |
protected getTableHelper ( ) : Symfony\Component\Console\Helper\TableHelper | ||
return | Symfony\Component\Console\Helper\TableHelper |
public outputTable ( array $rows, array $headers = null ) | ||
$rows | array | |
$headers | array |
public progressFinish ( ) : void | ||
return | void |
public progressStart ( integer $max = null ) : void | ||
$max | integer | Maximum steps. If NULL an indeterminate progress bar is rendered |
return | void |
public select ( string | array $question, array $choices, boolean $default = null, boolean $multiSelect = false, boolean | integer $attempts = false ) : integer | string | array | ||
$question | string | array | The question to ask. If an array each array item is turned into one line of a multi-line question |
$choices | array | List of choices to pick from |
$default | boolean | The default answer if the user enters nothing |
$multiSelect | boolean | If TRUE the result will be an array with the selected options. Multiple options can be given separated by commas |
$attempts | boolean | integer | Max number of times to ask before giving up (false by default, which means infinite) |
return | integer | string | array | The selected value or values (the key of the choices array) |
protected DialogHelper,Symfony\Component\Console\Helper $dialogHelper | ||
return |
protected ConsoleOutput,Symfony\Component\Console\Output $output | ||
return | Symfony\Component\Console\Output\ConsoleOutput |
protected ProgressHelper,Symfony\Component\Console\Helper $progressHelper | ||
return | Symfony\Component\Console\Helper\ProgressHelper |