Overview

Namespaces

  • Evenement
  • None
  • Peridot
    • Console
    • Core
    • Reporter
    • Runner
    • Scope
    • Test
  • Symfony
    • Component
      • Console
        • Command
        • Descriptor
        • Event
        • Exception
        • Formatter
        • Helper
        • Input
        • Logger
        • Output
        • Question
        • Style
        • Tester
        • Tests
          • Command
          • Descriptor
          • Fixtures
          • Formatter
          • Helper
          • Input
          • Logger
          • Output
          • Style
          • Tester

Classes

  • DebugFormatterHelper
  • DescriptorHelper
  • DialogHelper
  • FormatterHelper
  • Helper
  • HelperSet
  • InputAwareHelper
  • ProcessHelper
  • ProgressBar
  • ProgressHelper
  • ProgressIndicator
  • QuestionHelper
  • SymfonyQuestionHelper
  • Table
  • TableCell
  • TableHelper
  • TableSeparator
  • TableStyle

Interfaces

  • HelperInterface
  • Overview
  • Namespace
  • Class

Class QuestionHelper

The QuestionHelper class provides helpers to interact with the user.

Symfony\Component\Console\Helper\Helper implements Symfony\Component\Console\Helper\HelperInterface
Extended by Symfony\Component\Console\Helper\QuestionHelper

Direct known subclasses

Symfony\Component\Console\Helper\SymfonyQuestionHelper
Namespace: Symfony\Component\Console\Helper
Author: Fabien Potencier fabien@symfony.com
Located at Helper/QuestionHelper.php
Methods summary
public string
# ask( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output, Symfony\Component\Console\Question\Question $question )

Asks a question to the user.

Asks a question to the user.

Parameters

$input
An InputInterface instance
$output
An OutputInterface instance
$question
The question to ask

Returns

string
The user answer

Throws

Symfony\Component\Console\Exception\RuntimeException
If there is no data to read in the input stream
public
# setInputStream( resource $stream )

Sets the input stream to read from when interacting with the user.

Sets the input stream to read from when interacting with the user.

This is mainly useful for testing purpose.

Parameters

$stream
The input stream

Throws

Symfony\Component\Console\Exception\InvalidArgumentException
In case the stream is not a resource
public resource
# getInputStream( )

Returns the helper's input stream.

Returns the helper's input stream.

Returns

resource
public string
# getName( )

Returns the canonical name of this helper.

Returns the canonical name of this helper.

Returns

string
The canonical name
public boolean|mixed|null|string
# doAsk( Symfony\Component\Console\Output\OutputInterface $output, Symfony\Component\Console\Question\Question $question )

Asks the question to the user.

Asks the question to the user.

This method is public for PHP 5.3 compatibility, it should be private.

Parameters

$output
$question

Returns

boolean|mixed|null|string

Throws

Exception
RuntimeException
protected
# writePrompt( Symfony\Component\Console\Output\OutputInterface $output, Symfony\Component\Console\Question\Question $question )

Outputs the question prompt.

Outputs the question prompt.

Parameters

$output
$question
protected
# writeError( Symfony\Component\Console\Output\OutputInterface $output, Exception $error )

Outputs an error message.

Outputs an error message.

Parameters

$output
$error
Methods inherited from Symfony\Component\Console\Helper\Helper
formatMemory(), formatTime(), getHelperSet(), setHelperSet(), strlen(), strlenWithoutDecoration()
Properties inherited from Symfony\Component\Console\Helper\Helper
$helperSet
Peridot API documentation generated by ApiGen