PHP Class Platformsh\Cli\Helper\QuestionHelper

Inheritance: extends Symfony\Component\Console\Helper\QuestionHelper, implements Platformsh\Cli\Console\OutputAwareInterface, implements Symfony\Component\Console\Input\InputAwareInterface
Show file Open project: commerceguys/platform-cli Class Usage Examples

Public Methods

Method Description
__construct ( Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null ) QuestionHelper constructor.
askInput ( string $questionText, mixed $default = null ) : string Ask a simple question which requires input.
choose ( array $items, string $text = 'Enter a number to choose an item:', mixed $default = null ) : mixed
confirm ( string $questionText, boolean $default = true ) : boolean Ask the user to confirm an action.
setInput ( Symfony\Component\Console\Input\InputInterface $input )
setOutput ( Symfony\Component\Console\Output\OutputInterface $output )

Method Details

__construct() public method

QuestionHelper constructor.
public __construct ( Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface

askInput() public method

Ask a simple question which requires input.
public askInput ( string $questionText, mixed $default = null ) : string
$questionText string
$default mixed
return string The user's answer.

choose() public method

public choose ( array $items, string $text = 'Enter a number to choose an item:', mixed $default = null ) : mixed
$items array An associative array of choices.
$text string Some text to precede the choices.
$default mixed A default (as a key in $items).
return mixed The chosen item (as a key in $items).

confirm() public method

Ask the user to confirm an action.
public confirm ( string $questionText, boolean $default = true ) : boolean
$questionText string
$default boolean
return boolean

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