PHP Class Gush\Helper\StyleHelper

Inheritance: extends Symfony\Component\Console\Helper\Helper, implements Gush\Helper\OutputAwareInterface, implements Symfony\Component\Console\Input\InputAwareInterface, implements Symfony\Component\Console\Style\StyleInterface
Show file Open project: gushphp/gush Class Usage Examples

Public Methods

Method Description
__construct ( Symfony\Component\Console\Helper\QuestionHelper $questionHelper )
ask ( $question, $default = null, $validator = null )
askHidden ( $question, $validator = null )
askQuestion ( Symfony\Component\Console\Question\Question $question ) : string
block ( string | array $messages, string | null $type = null, string | null $style = null, string $prefix = ' ', boolean $padding = false ) Formats a message as a block of text.
caution ( $message )
choice ( $question, array $choices, $default = null )
comment ( $message )
confirm ( $question, $default = true )
createProgressBar ( $max )
detailsTable ( array $rows )
error ( $message )
getName ( )
getStyle ( ) : SymfonyStyle
getVerbosity ( )
isDecorated ( )
listing ( array $elements )
newLine ( $count = 1 )
note ( $message )
numberedChoice ( string $question, array $choices, string | integer | null $default = null ) : string | integer | null NumberedChoice works the same as a normal choice but prompts for a numbered list of options.
progressAdvance ( $step = 1 )
progressFinish ( )
progressStart ( $max )
section ( $message )
setDecorated ( $decorated )
setInput ( Symfony\Component\Console\Input\InputInterface $input )
setOutput ( Symfony\Component\Console\Output\OutputInterface $output )
setVerbosity ( $level )
success ( $message )
table ( array $headers, array $rows )
text ( $message )
title ( $message )
warning ( $message )
write ( $messages, $newline = false, $type = SymfonyStyle::OUTPUT_NORMAL )
writeln ( $messages, $type = SymfonyStyle::OUTPUT_NORMAL )

Method Details

__construct() public method

public __construct ( Symfony\Component\Console\Helper\QuestionHelper $questionHelper )
$questionHelper Symfony\Component\Console\Helper\QuestionHelper

ask() public method

public ask ( $question, $default = null, $validator = null )

askHidden() public method

public askHidden ( $question, $validator = null )

askQuestion() public method

public askQuestion ( Symfony\Component\Console\Question\Question $question ) : string
$question Symfony\Component\Console\Question\Question
return string

block() public method

Formats a message as a block of text.
public block ( string | array $messages, string | null $type = null, string | null $style = null, string $prefix = ' ', boolean $padding = false )
$messages string | array The message to write in the block
$type string | null The block type (added in [] on first line)
$style string | null The style to apply to the whole block
$prefix string The prefix for the block
$padding boolean Whether to add vertical padding

caution() public method

public caution ( $message )

choice() public method

public choice ( $question, array $choices, $default = null )
$choices array

comment() public method

public comment ( $message )

confirm() public method

public confirm ( $question, $default = true )

createProgressBar() public method

public createProgressBar ( $max )

detailsTable() public method

public detailsTable ( array $rows )
$rows array

error() public method

public error ( $message )

getName() public method

public getName ( )

getStyle() public method

public getStyle ( ) : SymfonyStyle
return Symfony\Component\Console\Style\SymfonyStyle

getVerbosity() public method

public getVerbosity ( )

isDecorated() public method

public isDecorated ( )

listing() public method

public listing ( array $elements )
$elements array

newLine() public method

public newLine ( $count = 1 )

note() public method

public note ( $message )

numberedChoice() public method

$choices: * key0: Label1 * key1: Label2 * key2: Label3 Shows: * [0]: Label1 * [1]: Label2 * [2]: Label3 When option 0 is selected key0 is returned (instead of Label1).
public numberedChoice ( string $question, array $choices, string | integer | null $default = null ) : string | integer | null
$question string
$choices array
$default string | integer | null Default selection (by key)
return string | integer | null

progressAdvance() public method

public progressAdvance ( $step = 1 )

progressFinish() public method

public progressFinish ( )

progressStart() public method

public progressStart ( $max )

section() public method

public section ( $message )

setDecorated() public method

public setDecorated ( $decorated )

setInput() public method

public setInput ( Symfony\Component\Console\Input\InputInterface $input )
$input Symfony\Component\Console\Input\InputInterface

setOutput() public method

public setOutput ( Symfony\Component\Console\Output\OutputInterface $output )
$output Symfony\Component\Console\Output\OutputInterface

setVerbosity() public method

public setVerbosity ( $level )

success() public method

public success ( $message )

table() public method

public table ( array $headers, array $rows )
$headers array
$rows array

text() public method

public text ( $message )

title() public method

public title ( $message )

warning() public method

public warning ( $message )

write() public method

public write ( $messages, $newline = false, $type = SymfonyStyle::OUTPUT_NORMAL )

writeln() public method

public writeln ( $messages, $type = SymfonyStyle::OUTPUT_NORMAL )