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

  • ChoiceQuestion
  • ConfirmationQuestion
  • Question
  • Overview
  • Namespace
  • Class

Class Question

Represents a Question.

Direct known subclasses

Symfony\Component\Console\Question\ChoiceQuestion, Symfony\Component\Console\Question\ConfirmationQuestion
Namespace: Symfony\Component\Console\Question
Author: Fabien Potencier fabien@symfony.com
Located at Question/Question.php
Methods summary
public
# __construct( string $question, mixed $default = null )

Constructor.

Constructor.

Parameters

$question
The question to ask to the user
$default
The default answer to return if the user enters nothing
public string
# getQuestion( )

Returns the question.

Returns the question.

Returns

string
public mixed
# getDefault( )

Returns the default answer.

Returns the default answer.

Returns

mixed
public boolean
# isHidden( )

Returns whether the user response must be hidden.

Returns whether the user response must be hidden.

Returns

boolean
public Symfony\Component\Console\Question\Question
# setHidden( boolean $hidden )

Sets whether the user response must be hidden or not.

Sets whether the user response must be hidden or not.

Parameters

$hidden

Returns

Symfony\Component\Console\Question\Question
The current instance

Throws

Symfony\Component\Console\Exception\LogicException
In case the autocompleter is also used
public boolean
# isHiddenFallback( )

In case the response can not be hidden, whether to fallback on non-hidden question or not.

In case the response can not be hidden, whether to fallback on non-hidden question or not.

Returns

boolean
public Symfony\Component\Console\Question\Question
# setHiddenFallback( boolean $fallback )

Sets whether to fallback on non-hidden question if the response can not be hidden.

Sets whether to fallback on non-hidden question if the response can not be hidden.

Parameters

$fallback

Returns

Symfony\Component\Console\Question\Question
The current instance
public null|array|Traversable
# getAutocompleterValues( )

Gets values for the autocompleter.

Gets values for the autocompleter.

Returns

null|array|Traversable
public Symfony\Component\Console\Question\Question
# setAutocompleterValues( null|array|Traversable $values )

Sets values for the autocompleter.

Sets values for the autocompleter.

Parameters

$values

Returns

Symfony\Component\Console\Question\Question
The current instance

Throws

Symfony\Component\Console\Exception\InvalidArgumentException
Symfony\Component\Console\Exception\LogicException
public Symfony\Component\Console\Question\Question
# setValidator( null|callable $validator )

Sets a validator for the question.

Sets a validator for the question.

Parameters

$validator

Returns

Symfony\Component\Console\Question\Question
The current instance
public null|callable
# getValidator( )

Gets the validator for the question.

Gets the validator for the question.

Returns

null|callable
public Symfony\Component\Console\Question\Question
# setMaxAttempts( null|integer $attempts )

Sets the maximum number of attempts.

Sets the maximum number of attempts.

Null means an unlimited number of attempts.

Parameters

$attempts

Returns

Symfony\Component\Console\Question\Question
The current instance

Throws

Symfony\Component\Console\Exception\InvalidArgumentException
In case the number of attempts is invalid.
public null|integer
# getMaxAttempts( )

Gets the maximum number of attempts.

Gets the maximum number of attempts.

Null means an unlimited number of attempts.

Returns

null|integer
public Symfony\Component\Console\Question\Question
# setNormalizer( callable $normalizer )

Sets a normalizer for the response.

Sets a normalizer for the response.

The normalizer can be a callable (a string), a closure or a class implementing __invoke.

Parameters

$normalizer

Returns

Symfony\Component\Console\Question\Question
The current instance
public callable
# getNormalizer( )

Gets the normalizer for the response.

Gets the normalizer for the response.

The normalizer can ba a callable (a string), a closure or a class implementing __invoke.

Returns

callable
protected
# isAssoc( $array )
Peridot API documentation generated by ApiGen