[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/symfony/console/Helper/ -> DialogHelper.php (summary)

(no description)

File Size: 502 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

DialogHelper:: (13 methods):
  __construct()
  select()
  ask()
  askConfirmation()
  askHiddenResponse()
  askAndValidate()
  askHiddenResponseAndValidate()
  setInputStream()
  getInputStream()
  getName()
  getShell()
  hasSttyAvailable()
  validateAttempts()


Class: DialogHelper  - X-Ref

The Dialog class provides helpers to interact with the user.

__construct($triggerDeprecationError = true)   X-Ref
No description

select(OutputInterface $output, $question, $choices, $default = null, $attempts = false, $errorMessage = 'Value "%s" is invalid', $multiselect = false)   X-Ref
Asks the user to select a value.

param: OutputInterface $output       An Output instance
param: string|array    $question     The question to ask
param: array           $choices      List of choices to pick from
param: bool|string     $default      The default answer if the user enters nothing
param: bool|int        $attempts     Max number of times to ask before giving up (false by default, which means infinite)
param: string          $errorMessage Message which will be shown if invalid value from choice list would be picked
param: bool            $multiselect  Select more than one value separated by comma
return: int|string|array The selected value or values (the key of the choices array)

ask(OutputInterface $output, $question, $default = null, array $autocomplete = null)   X-Ref
Asks a question to the user.

param: OutputInterface $output       An Output instance
param: string|array    $question     The question to ask
param: string          $default      The default answer if none is given by the user
param: array           $autocomplete List of values to autocomplete
return: string The user answer

askConfirmation(OutputInterface $output, $question, $default = true)   X-Ref
Asks a confirmation to the user.

The question will be asked until the user answers by nothing, yes, or no.

param: OutputInterface $output   An Output instance
param: string|array    $question The question to ask
param: bool            $default  The default answer if the user enters nothing
return: bool true if the user has confirmed, false otherwise

askHiddenResponse(OutputInterface $output, $question, $fallback = true)   X-Ref
Asks a question to the user, the response is hidden.

param: OutputInterface $output   An Output instance
param: string|array    $question The question
param: bool            $fallback In case the response can not be hidden, whether to fallback on non-hidden question or not
return: string The answer

askAndValidate(OutputInterface $output, $question, $validator, $attempts = false, $default = null, array $autocomplete = null)   X-Ref
Asks for a value and validates the response.

The validator receives the data to validate. It must return the
validated data when the data is valid and throw an exception
otherwise.

param: OutputInterface $output       An Output instance
param: string|array    $question     The question to ask
param: callable        $validator    A PHP callback
param: int|false       $attempts     Max number of times to ask before giving up (false by default, which means infinite)
param: string          $default      The default answer if none is given by the user
param: array           $autocomplete List of values to autocomplete
return: mixed

askHiddenResponseAndValidate(OutputInterface $output, $question, $validator, $attempts = false, $fallback = true)   X-Ref
Asks for a value, hide and validates the response.

The validator receives the data to validate. It must return the
validated data when the data is valid and throw an exception
otherwise.

param: OutputInterface $output    An Output instance
param: string|array    $question  The question to ask
param: callable        $validator A PHP callback
param: int|false       $attempts  Max number of times to ask before giving up (false by default, which means infinite)
param: bool            $fallback  In case the response can not be hidden, whether to fallback on non-hidden question or not
return: string The response

setInputStream($stream)   X-Ref
Sets the input stream to read from when interacting with the user.

This is mainly useful for testing purpose.

param: resource $stream The input stream

getInputStream()   X-Ref
Returns the helper's input stream.

return: resource|null The input stream or null if the default STDIN is used

getName()   X-Ref
{@inheritdoc}


getShell()   X-Ref
Return a valid Unix shell.

return: string|bool The valid shell name, false in case no valid shell is found

hasSttyAvailable()   X-Ref
No description

validateAttempts($interviewer, OutputInterface $output, $validator, $attempts)   X-Ref
Validate an attempt.

param: callable        $interviewer A callable that will ask for a question and return the result
param: OutputInterface $output      An Output instance
param: callable        $validator   A PHP callback
param: int|false       $attempts    Max number of times to ask before giving up; false will ask infinitely
return: string The validated response



Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1